Skip to content

Commit 9ec2e09

Browse files
global cache first
1 parent 903cc96 commit 9ec2e09

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

Objects/codeobject.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,10 @@ intern_constants(PyObject *tuple, int *modified)
214214
continue;
215215
}
216216
#if !defined(Py_GIL_DISABLED)
217-
PyObject *interned = PyDict_GetItemWithError(interned_dict, v);
218-
if (interned == NULL && PyErr_Occurred()) {
219-
goto error;
220-
}
221-
if (!interned) {
222-
interned = (PyObject *)_Py_hashtable_get(INTERNED_STRINGS, v);
223-
if (interned == NULL && PyErr_Occurred()) {
224-
goto error;
225-
}
217+
PyObject *interned = _Py_hashtable_get(INTERNED_STRINGS, v);
218+
if (interned == NULL) {
219+
interned = PyDict_GetItemWithError(interned_dict, v);
220+
if (PyErr_Occurred()) goto error;
226221
}
227222
if (interned != NULL && interned != v) {
228223
Py_INCREF(interned);

0 commit comments

Comments
 (0)