Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2016-07-31 10:22:04 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-07-31 10:22:04 +0300
commita96c9def6f57269f6ff10a189cd55ff43dc3a15f (patch)
tree39e868feff4d58deadf062627d2ece40c8bc25db /source/blender/python/intern/bpy_app_translations.c
parente97ab8347a16f84bdddeaf53305cd9a7f42860ab (diff)
PyAPI: minor optimization for dictionary creation
Pass size when its known.
Diffstat (limited to 'source/blender/python/intern/bpy_app_translations.c')
-rw-r--r--source/blender/python/intern/bpy_app_translations.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_app_translations.c b/source/blender/python/intern/bpy_app_translations.c
index b90deafb377..6ba858f0228 100644
--- a/source/blender/python/intern/bpy_app_translations.c
+++ b/source/blender/python/intern/bpy_app_translations.c
@@ -675,7 +675,7 @@ static PyObject *app_translations_new(PyTypeObject *type, PyObject *UNUSED(args)
_translations->contexts = app_translations_contexts_make();
- py_ctxts = PyDict_New();
+ py_ctxts = _PyDict_NewPresized(ARRAY_SIZE(_contexts));
for (ctxt = _contexts; ctxt->c_id; ctxt++) {
PyObject *val = PyUnicode_FromString(ctxt->py_id);
PyDict_SetItemString(py_ctxts, ctxt->c_id, val);