]> granicus.if.org Git - python/commitdiff
CallMethod is faster with a NULL third-argument than with an empty format string.
authorRaymond Hettinger <python@rcn.com>
Tue, 29 Jan 2008 19:52:09 +0000 (19:52 +0000)
committerRaymond Hettinger <python@rcn.com>
Tue, 29 Jan 2008 19:52:09 +0000 (19:52 +0000)
Python/bltinmodule.c

index 444fc1e7183152301f888004850cee49c9c5e8db..cd74758eea71bef29124b36c99acaf2da21450c9 100644 (file)
@@ -2050,7 +2050,7 @@ builtin_trunc(PyObject *self, PyObject *number)
         /* XXX: The py3k branch gets better errors for this by using
            _PyType_Lookup(), but since float's mro isn't set in py2.6,
            we just use PyObject_CallMethod here. */
-       return PyObject_CallMethod(number, "__trunc__", "");
+       return PyObject_CallMethod(number, "__trunc__", NULL);
 }
 
 PyDoc_STRVAR(trunc_doc,