Make filter(bool, ...) as fast as filter(None, ...).
This commit is contained in:
parent
e5402fb340
commit
689735562d
@ -197,7 +197,7 @@ builtin_filter(PyObject *self, PyObject *args)
|
||||
break;
|
||||
}
|
||||
|
||||
if (func == Py_None) {
|
||||
if (func == (PyObject *)&PyBool_Type || func == Py_None) {
|
||||
ok = PyObject_IsTrue(item);
|
||||
}
|
||||
else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user