Lines Matching refs:list

7 /* Overallocate the initial list to reduce the number of reallocs for small
25 if (PyList_Append(list, sub)) { \
38 PyList_SET_ITEM(list, count, sub); \
40 if (PyList_Append(list, sub)) { \
50 /* Always force the list to the expected size. */
51 #define FIX_PREALLOC_SIZE(list) Py_SET_SIZE(list, count)
59 PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
62 if (list == NULL)
75 /* No whitespace in str_obj, so just use it as list[0] */
77 PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
93 FIX_PREALLOC_SIZE(list);
94 return list;
97 Py_DECREF(list);
108 PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
111 if (list == NULL)
127 /* ch not in str_obj, so just use str_obj as list[0] */
129 PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
136 FIX_PREALLOC_SIZE(list);
137 return list;
140 Py_DECREF(list);
151 PyObject *list, *sub;
160 list = PyList_New(PREALLOC_SIZE(maxcount));
161 if (list == NULL)
175 /* No match in str_obj, so just use it as list[0] */
177 PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
184 FIX_PREALLOC_SIZE(list);
185 return list;
188 Py_DECREF(list);
198 PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
201 if (list == NULL)
214 /* No whitespace in str_obj, so just use it as list[0] */
216 PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
232 FIX_PREALLOC_SIZE(list);
233 if (PyList_Reverse(list) < 0)
235 return list;
238 Py_DECREF(list);
249 PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
252 if (list == NULL)
267 /* ch not in str_obj, so just use str_obj as list[0] */
269 PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
276 FIX_PREALLOC_SIZE(list);
277 if (PyList_Reverse(list) < 0)
279 return list;
282 Py_DECREF(list);
293 PyObject *list, *sub;
302 list = PyList_New(PREALLOC_SIZE(maxcount));
303 if (list == NULL)
316 /* No match in str_obj, so just use it as list[0] */
318 PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
325 FIX_PREALLOC_SIZE(list);
326 if (PyList_Reverse(list) < 0)
328 return list;
331 Py_DECREF(list);
340 /* This does not use the preallocated list because splitlines is
350 PyObject *list = PyList_New(0);
353 if (list == NULL)
375 /* No linebreak in str_obj, so just use it as list[0] */
376 if (PyList_Append(list, str_obj))
384 return list;
387 Py_DECREF(list);