skip unnecessary strcmp in create_builtin

This commit is contained in:
ahgamut 2022-06-21 09:45:37 +05:30
parent f242ef4a09
commit e44528ee86

View file

@ -95,8 +95,8 @@ module _imp
typedef struct { typedef struct {
const char *name; const char *name;
union { union {
struct _inittab *tab; const struct _inittab *tab;
struct _frozen *frz; const struct _frozen *frz;
}; };
} initentry; } initentry;
@ -1183,7 +1183,6 @@ _imp_create_builtin(PyObject *module, PyObject *spec)
if (res != NULL) { if (res != NULL) {
p = res->tab; p = res->tab;
PyModuleDef *def; PyModuleDef *def;
if (_PyUnicode_EqualToASCIIString(name, p->name)) {
if (p->initfunc == NULL) { if (p->initfunc == NULL) {
/* Cannot re-init internal module ("sys" or "builtins") */ /* Cannot re-init internal module ("sys" or "builtins") */
mod = PyImport_AddModule(namestr); mod = PyImport_AddModule(namestr);
@ -1214,7 +1213,6 @@ _imp_create_builtin(PyObject *module, PyObject *spec)
return mod; return mod;
} }
} }
}
Py_DECREF(name); Py_DECREF(name);
Py_RETURN_NONE; Py_RETURN_NONE;
} }