PyAPI: minor optimization for dictionary creation

Pass size when its known.
This commit is contained in:
2016-07-31 17:22:04 +10:00
parent e97ab8347a
commit a96c9def6f
6 changed files with 10 additions and 10 deletions

View File

@@ -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);