Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5098b58 commit bd5f0e8Copy full SHA for bd5f0e8
1 file changed
Python/bltinmodule.c
@@ -469,19 +469,19 @@ filter_next(filterobject *lz)
469
PyObject *it = lz->it;
470
long ok;
471
PyObject *(*iternext)(PyObject *);
472
+ int checktrue = lz->func == Py_None || lz->func == (PyObject *)&PyBool_Type;
473
474
iternext = *Py_TYPE(it)->tp_iternext;
475
for (;;) {
476
item = iternext(it);
477
if (item == NULL)
478
return NULL;
479
- if (lz->func == Py_None || lz->func == (PyObject *)&PyBool_Type) {
480
+ if (checktrue) {
481
ok = PyObject_IsTrue(item);
482
} else {
483
PyObject *good;
- good = PyObject_CallFunctionObjArgs(lz->func,
484
- item, NULL);
+ good = PyObject_CallFunctionObjArgs(lz->func, item, NULL);
485
if (good == NULL) {
486
Py_DECREF(item);
487
0 commit comments