mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +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;
|
||||
}
|
||||
|
||||
if (func == Py_None) {
|
||||
if (func == (PyObject *)&PyBool_Type || func == Py_None) {
|
||||
ok = PyObject_IsTrue(item);
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue