Commit 68973556 authored by Neil Schemenauer's avatar Neil Schemenauer

Make filter(bool, ...) as fast as filter(None, ...).

parent e5402fb3
...@@ -197,7 +197,7 @@ builtin_filter(PyObject *self, PyObject *args) ...@@ -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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment