diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-07-31 10:22:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-07-31 10:22:04 +0300 |
commit | a96c9def6f57269f6ff10a189cd55ff43dc3a15f (patch) | |
tree | 39e868feff4d58deadf062627d2ece40c8bc25db /source/blender/python/intern/bpy_library_load.c | |
parent | e97ab8347a16f84bdddeaf53305cd9a7f42860ab (diff) |
PyAPI: minor optimization for dictionary creation
Pass size when its known.
Diffstat (limited to 'source/blender/python/intern/bpy_library_load.c')
-rw-r--r-- | source/blender/python/intern/bpy_library_load.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/python/intern/bpy_library_load.c b/source/blender/python/intern/bpy_library_load.c index 37a7e0e23dd..ec69abbb1df 100644 --- a/source/blender/python/intern/bpy_library_load.c +++ b/source/blender/python/intern/bpy_library_load.c @@ -210,7 +210,7 @@ static PyObject *bpy_lib_load(PyObject *UNUSED(self), PyObject *args, PyObject * ret->flag = ((is_link ? FILE_LINK : 0) | (is_rel ? FILE_RELPATH : 0)); - ret->dict = PyDict_New(); + ret->dict = _PyDict_NewPresized(MAX_LIBARRAY); return (PyObject *)ret; } @@ -240,7 +240,7 @@ static PyObject *bpy_lib_enter(BPy_Library *self, PyObject *UNUSED(args)) { PyObject *ret; BPy_Library *self_from; - PyObject *from_dict = PyDict_New(); + PyObject *from_dict = _PyDict_NewPresized(MAX_LIBARRAY); ReportList reports; BKE_reports_init(&reports, RPT_STORE); |