Avoid inefficient way to call functions without argument

Don't pass "()" format to PyObject_CallXXX() to call a function without
argument: pass NULL as the format string instead. It avoids to have to parse a
string to produce 0 argument.
This commit is contained in:
Victor Stinner 2016-09-05 17:53:15 -07:00
parent ca08301ae0
commit ad8c83ad6b
5 changed files with 11 additions and 11 deletions

View file

@ -468,7 +468,7 @@ va_build_value(const char *format, va_list va, int flags)
int n = countformat(f, '\0');
va_list lva;
Py_VA_COPY(lva, va);
Py_VA_COPY(lva, va);
if (n < 0)
return NULL;