Remove micro-optimization that no longer shows a benefit. (GH-32397)

This commit is contained in:
Raymond Hettinger 2022-04-06 22:00:47 -05:00 committed by GitHub
parent 1d0f08fa46
commit 5aee46b31b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 21 deletions

View File

@ -1536,12 +1536,6 @@ deque_sizeof(dequeobject *deque, void *unused)
PyDoc_STRVAR(sizeof_doc,
"D.__sizeof__() -- size of D in memory, in bytes");
static int
deque_bool(dequeobject *deque)
{
return Py_SIZE(deque) != 0;
}
static PyObject *
deque_get_maxlen(dequeobject *deque, void *Py_UNUSED(ignored))
{
@ -1572,20 +1566,6 @@ static PySequenceMethods deque_as_sequence = {
(ssizeargfunc)deque_inplace_repeat, /* sq_inplace_repeat */
};
static PyNumberMethods deque_as_number = {
0, /* nb_add */
0, /* nb_subtract */
0, /* nb_multiply */
0, /* nb_remainder */
0, /* nb_divmod */
0, /* nb_power */
0, /* nb_negative */
0, /* nb_positive */
0, /* nb_absolute */
(inquiry)deque_bool, /* nb_bool */
0, /* nb_invert */
};
static PyObject *deque_iter(dequeobject *deque);
static PyObject *deque_reviter(dequeobject *deque, PyObject *Py_UNUSED(ignored));
PyDoc_STRVAR(reversed_doc,
@ -1650,7 +1630,7 @@ static PyTypeObject deque_type = {
0, /* tp_setattr */
0, /* tp_as_async */
deque_repr, /* tp_repr */
&deque_as_number, /* tp_as_number */
0, /* tp_as_number */
&deque_as_sequence, /* tp_as_sequence */
0, /* tp_as_mapping */
PyObject_HashNotImplemented, /* tp_hash */