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_rna_id_collection.c | |
parent | e97ab8347a16f84bdddeaf53305cd9a7f42860ab (diff) |
PyAPI: minor optimization for dictionary creation
Pass size when its known.
Diffstat (limited to 'source/blender/python/intern/bpy_rna_id_collection.c')
-rw-r--r-- | source/blender/python/intern/bpy_rna_id_collection.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_rna_id_collection.c b/source/blender/python/intern/bpy_rna_id_collection.c index 104e3e47646..31189ba4dee 100644 --- a/source/blender/python/intern/bpy_rna_id_collection.c +++ b/source/blender/python/intern/bpy_rna_id_collection.c @@ -198,7 +198,7 @@ static PyObject *bpy_user_map(PyObject *UNUSED(self), PyObject *args, PyObject * PyObject **subset_array = PySequence_Fast_ITEMS(subset_fast); Py_ssize_t subset_len = PySequence_Fast_GET_SIZE(subset_fast); - data_cb.user_map = PyDict_New(); + data_cb.user_map = _PyDict_NewPresized(subset_len); data_cb.is_subset = true; for (; subset_len; subset_array++, subset_len--) { PyObject *set = PySet_New(NULL); |