PyCFunction_Call(): Combined two switch cases w/ identical bodies.

This commit is contained in:
Tim Peters 2003-01-05 07:22:44 +00:00
parent 15ec3731cf
commit 541ceec3e6
1 changed files with 2 additions and 4 deletions

View File

@ -70,6 +70,7 @@ PyCFunction_Call(PyObject *func, PyObject *arg, PyObject *kw)
return (*meth)(self, arg); return (*meth)(self, arg);
break; break;
case METH_VARARGS | METH_KEYWORDS: case METH_VARARGS | METH_KEYWORDS:
case METH_OLDARGS | METH_KEYWORDS:
return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
case METH_NOARGS: case METH_NOARGS:
if (kw == NULL || PyDict_Size(kw) == 0) { if (kw == NULL || PyDict_Size(kw) == 0) {
@ -104,10 +105,7 @@ PyCFunction_Call(PyObject *func, PyObject *arg, PyObject *kw)
return (*meth)(self, arg); return (*meth)(self, arg);
} }
break; break;
case METH_OLDARGS | METH_KEYWORDS:
return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
default: default:
/* should never get here ??? */
PyErr_BadInternalCall(); PyErr_BadInternalCall();
return NULL; return NULL;
} }
@ -267,7 +265,7 @@ listmethodchain(PyMethodChain *chain)
PyMethodDef *ml; PyMethodDef *ml;
int i, n; int i, n;
PyObject *v; PyObject *v;
n = 0; n = 0;
for (c = chain; c != NULL; c = c->link) { for (c = chain; c != NULL; c = c->link) {
for (ml = c->methods; ml->ml_name != NULL; ml++) for (ml = c->methods; ml->ml_name != NULL; ml++)