Skip to content

Commit 68c122c

Browse files
committed
Clean up
1 parent 9d1b301 commit 68c122c

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

Objects/typeobject.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6137,16 +6137,9 @@ _PyType_LookupRefAndVersion(PyTypeObject *type, PyObject *name, unsigned int *ve
61376137
static int
61386138
should_assign_version_tag(PyTypeObject *type, PyObject *name, unsigned int version_tag)
61396139
{
6140-
if (version_tag != 0) {
6141-
return 0;
6142-
}
6143-
if (FT_ATOMIC_LOAD_UINT16_RELAXED(type->tp_versions_used) >= MAX_VERSIONS_PER_CLASS) {
6144-
return 0;
6145-
}
6146-
if (!MCACHE_CACHEABLE_NAME(name)) {
6147-
return 0;
6148-
}
6149-
return 1;
6140+
return (version_tag == 0
6141+
&& FT_ATOMIC_LOAD_UINT16_RELAXED(type->tp_versions_used) < MAX_VERSIONS_PER_CLASS
6142+
&& MCACHE_CACHEABLE_NAME(name));
61506143
}
61516144

61526145
unsigned int
@@ -6197,9 +6190,6 @@ _PyType_LookupStackRefAndVersion(PyTypeObject *type, PyObject *name, _PyStackRef
61976190
/* We may end up clearing live exceptions below, so make sure it's ours. */
61986191
assert(!PyErr_Occurred());
61996192

6200-
// We need to atomically do the lookup and capture the version before
6201-
// anyone else can modify our mro or mutate the type.
6202-
62036193
int res;
62046194
PyInterpreterState *interp = _PyInterpreterState_GET();
62056195

0 commit comments

Comments
 (0)