mirror of
https://github.com/python/cpython.git
synced 2025-09-18 22:50:26 +00:00
bpo-34397: Remove redundant overflow checks in list and tuple implementation. (GH-8757)
This commit is contained in:
parent
ef16958d17
commit
e682b26a6b
2 changed files with 4 additions and 15 deletions
|
@ -486,8 +486,7 @@ tupleconcat(PyTupleObject *a, PyObject *bb)
|
|||
Py_INCREF(a);
|
||||
return (PyObject *)a;
|
||||
}
|
||||
if (Py_SIZE(a) > PY_SSIZE_T_MAX - Py_SIZE(b))
|
||||
return PyErr_NoMemory();
|
||||
assert((size_t)Py_SIZE(a) + (size_t)Py_SIZE(b) < PY_SSIZE_T_MAX);
|
||||
size = Py_SIZE(a) + Py_SIZE(b);
|
||||
if (size == 0) {
|
||||
return PyTuple_New(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue