##// END OF EJS Templates
parsers: add an API to create a new presized dict
Siddharth Agarwal -
r25584:72b2711f default
parent child Browse files
Show More
@@ -185,6 +185,16 static inline PyObject *_dict_new_presiz
185 185 return _PyDict_NewPresized(((1 + expected_size) / 2) * 3);
186 186 }
187 187
188 static PyObject *dict_new_presized(PyObject *self, PyObject *args)
189 {
190 Py_ssize_t expected_size;
191
192 if (!PyArg_ParseTuple(args, "n:make_presized_dict", &expected_size))
193 return NULL;
194
195 return _dict_new_presized(expected_size);
196 }
197
188 198 static PyObject *make_file_foldmap(PyObject *self, PyObject *args)
189 199 {
190 200 PyObject *dmap, *spec_obj, *normcase_fallback;
@@ -2524,6 +2534,8 static PyMethodDef methods[] = {
2524 2534 {"parse_index2", parse_index2, METH_VARARGS, "parse a revlog index\n"},
2525 2535 {"asciilower", asciilower, METH_VARARGS, "lowercase an ASCII string\n"},
2526 2536 {"asciiupper", asciiupper, METH_VARARGS, "uppercase an ASCII string\n"},
2537 {"dict_new_presized", dict_new_presized, METH_VARARGS,
2538 "construct a dict with an expected size\n"},
2527 2539 {"make_file_foldmap", make_file_foldmap, METH_VARARGS,
2528 2540 "make file foldmap\n"},
2529 2541 {"encodedir", encodedir, METH_VARARGS, "encodedir a path\n"},
General Comments 0
You need to be logged in to leave comments. Login now