Skip to content

Commit cc137e1

Browse files
committed
gh-92810: Remove useless fastpath on abc_registry check
1 parent 36d2f8d commit cc137e1

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

Modules/_abc.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -914,17 +914,6 @@ static int
914914
subclasscheck_check_registry(_abc_data *impl, PyObject *subclass,
915915
PyObject **result)
916916
{
917-
// Fast path: check subclass is in weakset directly.
918-
int ret = _in_weak_set(impl, &impl->_abc_registry, subclass);
919-
if (ret < 0) {
920-
*result = NULL;
921-
return -1;
922-
}
923-
if (ret > 0) {
924-
*result = Py_True;
925-
return 1;
926-
}
927-
928917
PyObject *registry_shared;
929918
Py_BEGIN_CRITICAL_SECTION(impl);
930919
registry_shared = impl->_abc_registry;
@@ -939,6 +928,7 @@ subclasscheck_check_registry(_abc_data *impl, PyObject *subclass,
939928
if (registry == NULL) {
940929
return -1;
941930
}
931+
int ret = 0;
942932
PyObject *key;
943933
Py_ssize_t pos = 0;
944934
Py_hash_t hash;

0 commit comments

Comments
 (0)