Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 34d33a5

Browse files
committed
removal u_qualname, since compiler_scope_qualname is only ever called once
1 parent a8a38b8 commit 34d33a5

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

Python/compile.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ struct compiler_unit {
104104
PySTEntryObject *u_ste;
105105

106106
PyObject *u_name;
107-
PyObject *u_qualname; /* dot-separated qualified name (lazy) */
108107
int u_scope_type;
109108

110109
/* The following fields are dicts that map objects to
@@ -507,7 +506,6 @@ compiler_unit_free(struct compiler_unit *u)
507506
}
508507
Py_CLEAR(u->u_ste);
509508
Py_CLEAR(u->u_name);
510-
Py_CLEAR(u->u_qualname);
511509
Py_CLEAR(u->u_consts);
512510
Py_CLEAR(u->u_names);
513511
Py_CLEAR(u->u_varnames);
@@ -660,11 +658,6 @@ compiler_scope_qualname(struct compiler *c, identifier scope_name)
660658
PyObject *capsule, *name, *seq, *dot_str, *locals_str;
661659

662660
u = c->u;
663-
if (u->u_qualname != NULL) {
664-
Py_INCREF(u->u_qualname);
665-
return u->u_qualname;
666-
}
667-
668661
seq = PyList_New(0);
669662
if (seq == NULL)
670663
return NULL;
@@ -714,7 +707,6 @@ compiler_scope_qualname(struct compiler *c, identifier scope_name)
714707
goto _error;
715708
name = PyUnicode_Join(dot_str, seq);
716709
Py_DECREF(seq);
717-
u->u_qualname = name;
718710
Py_XINCREF(name);
719711
return name;
720712

0 commit comments

Comments
 (0)