Skip to content

Commit 4c8c51d

Browse files
Remove tuple_alloc_2
1 parent e33a225 commit 4c8c51d

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

Objects/tupleobject.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -202,22 +202,6 @@ PyTuple_Pack(Py_ssize_t n, ...)
202202
return (PyObject *)result;
203203
}
204204

205-
static PyTupleObject *
206-
tuple_alloc_2(void)
207-
{
208-
Py_ssize_t size = 2;
209-
Py_ssize_t index = size - 1;
210-
PyTupleObject *result = _Py_FREELIST_POP(PyTupleObject, tuples[index]);
211-
if (result == NULL) {
212-
result = PyObject_GC_NewVar(PyTupleObject, &PyTuple_Type, size);
213-
if (result == NULL) {
214-
return NULL;
215-
}
216-
}
217-
_PyTuple_RESET_HASH_CACHE(result);
218-
return result;
219-
}
220-
221205
PyObject *
222206
_PyTuple_FromPair(PyObject *first, PyObject *second)
223207
{
@@ -233,7 +217,7 @@ _PyTuple_FromPairSteal(PyObject *first, PyObject *second)
233217
assert(first != NULL);
234218
assert(second != NULL);
235219

236-
PyTupleObject *op = tuple_alloc_2();
220+
PyTupleObject *op = tuple_alloc(2);
237221
if (op == NULL) {
238222
Py_DECREF(first);
239223
Py_DECREF(second);

0 commit comments

Comments
 (0)