mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Make filter(bool, ...) as fast as filter(None, ...).
This commit is contained in:
parent
e5402fb340
commit
689735562d
1 changed files with 1 additions and 1 deletions
|
@ -197,7 +197,7 @@ builtin_filter(PyObject *self, PyObject *args)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (func == Py_None) {
|
if (func == (PyObject *)&PyBool_Type || func == Py_None) {
|
||||||
ok = PyObject_IsTrue(item);
|
ok = PyObject_IsTrue(item);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue