Skip to content

Commit b3f203e

Browse files
committed
review comments
1 parent bfcad96 commit b3f203e

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

Objects/call.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -612,10 +612,6 @@ _PyObject_CallFunction_SizeT(PyObject *callable, const char *format, ...)
612612
}
613613

614614

615-
/* Resolve 'name' on 'obj' with _PyObject_GetMethodStackRef and call it
616-
directly, avoiding the bound-method object that PyObject_GetAttr()+call
617-
would allocate. Using the StackRef variant keeps method resolution
618-
reference-count-free on the fast path so it scales in free-threading. */
619615
static PyObject *
620616
callmethod(PyThreadState *tstate, PyObject *obj, PyObject *name,
621617
const char *format, va_list va)
@@ -626,8 +622,7 @@ callmethod(PyThreadState *tstate, PyObject *obj, PyObject *name,
626622
_PyThreadState_PushCStackRef(tstate, &self);
627623
_PyThreadState_PushCStackRef(tstate, &method);
628624
self.ref = PyStackRef_FromPyObjectBorrow(obj);
629-
/* On return, self.ref is non-NULL -> call method(self, *args) (unbound
630-
method or classmethod), NULL -> call method(*args). */
625+
631626
int res = _PyObject_GetMethodStackRef(tstate, &self.ref, name, &method.ref);
632627
if (res < 0) {
633628
goto exit;
@@ -673,7 +668,7 @@ callmethod(PyThreadState *tstate, PyObject *obj, PyObject *name,
673668
for (Py_ssize_t i = 0; i < nargs; i++) {
674669
Py_DECREF(built[i]);
675670
}
676-
if (built != NULL && built != small_stack) {
671+
if (built != small_stack) {
677672
PyMem_Free(built);
678673
}
679674

0 commit comments

Comments
 (0)