A nice little speed-up for filter():
- Use PyObject_Call() instead of PyEval_CallObject(), saves several layers of calls and checks. - Pre-allocate the argument tuple rather than calling Py_BuildValue() each time round the loop. - For filter(None, seq), avoid an INCREF and a DECREF.
G
Guido van Rossum committed
c7903a13d2dc58d2f239a4d3bb29703199b450e4
Parent: 8e82920