Skip to content

Commit 8c9c6d3

Browse files
authored
gh-123465: Ensure PyType_FromMetaclass avoids extra strcmp (GH-125460)
use else
1 parent b2bbdc5 commit 8c9c6d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Objects/typeobject.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -4761,10 +4761,10 @@ PyType_FromMetaclass(
47614761
if (strcmp(memb->name, "__weaklistoffset__") == 0) {
47624762
weaklistoffset_member = memb;
47634763
}
4764-
if (strcmp(memb->name, "__dictoffset__") == 0) {
4764+
else if (strcmp(memb->name, "__dictoffset__") == 0) {
47654765
dictoffset_member = memb;
47664766
}
4767-
if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
4767+
else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
47684768
vectorcalloffset_member = memb;
47694769
}
47704770
}

0 commit comments

Comments
 (0)