##// END OF EJS Templates
dirs: speed up by storing number of direct children per dir...
Martin von Zweigbergk -
r25016:42e89b87 default
parent child Browse files
Show More
@@ -69,7 +69,7 b' static int _addpath(PyObject *dirs, PyOb'
69 val = PyDict_GetItem(dirs, key);
69 val = PyDict_GetItem(dirs, key);
70 if (val != NULL) {
70 if (val != NULL) {
71 PyInt_AS_LONG(val) += 1;
71 PyInt_AS_LONG(val) += 1;
72 continue;
72 break;
73 }
73 }
74
74
75 /* Force Python to not reuse a small shared int. */
75 /* Force Python to not reuse a small shared int. */
@@ -114,9 +114,11 b' static int _delpath(PyObject *dirs, PyOb'
114 goto bail;
114 goto bail;
115 }
115 }
116
116
117 if (--PyInt_AS_LONG(val) <= 0 &&
117 if (--PyInt_AS_LONG(val) <= 0) {
118 PyDict_DelItem(dirs, key) == -1)
118 if (PyDict_DelItem(dirs, key) == -1)
119 goto bail;
119 goto bail;
120 } else
121 break;
120 Py_CLEAR(key);
122 Py_CLEAR(key);
121 }
123 }
122 ret = 0;
124 ret = 0;
General Comments 0
You need to be logged in to leave comments. Login now