Commit 72b5113a authored by Stefan Behnel's avatar Stefan Behnel

speed up __Pyx_PySet_Update() a little by calling it as an unbound method

parent 53eb0a27
......@@ -438,7 +438,7 @@ class UtilityCode(UtilityCodeBase):
replacements.append(cname)
return '%s(&%s, %s)' % (call, cname, ', '.join(args))
impl = re.sub(r'CALL_UNBOUND_METHOD\(([a-zA-Z_]+),\s*"([^"]+)"(,\s*[^),]+)+\)', externalise, impl)
impl = re.sub(r'CALL_UNBOUND_METHOD\(([a-zA-Z_]+),\s*"([^"]+)"((?:,\s*[^),]+)+)\)', externalise, impl)
assert 'CALL_UNBOUND_METHOD(' not in impl
return bool(replacements), impl
......
......@@ -477,7 +477,7 @@ static CYTHON_INLINE int __Pyx_PySet_Update(PyObject* set, PyObject* it) {
Py_DECREF(retval);
}
#endif
retval = __Pyx_PyObject_CallMethod1(set, PYIDENT("update"), it);
retval = CALL_UNBOUND_METHOD(PySet_Type, "update", set, it);
if (unlikely(!retval)) return -1;
Py_DECREF(retval);
return 0;
......
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