]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-123465: Ensure PyType_FromMetaclass avoids extra strcmp (GH-125460)
authorneonene <53406459+neonene@users.noreply.github.com>
Wed, 13 Nov 2024 17:09:26 +0000 (02:09 +0900)
committerGitHub <noreply@github.com>
Wed, 13 Nov 2024 17:09:26 +0000 (17:09 +0000)
use else

Objects/typeobject.c

index 4af7f0273aae91a948483bfc03e59b8be6d6051d..a6cf3da542b691371623744f1f1b2a2916e30dcf 100644 (file)
@@ -4761,10 +4761,10 @@ PyType_FromMetaclass(
                 if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                     weaklistoffset_member = memb;
                 }
-                if (strcmp(memb->name, "__dictoffset__") == 0) {
+                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                     dictoffset_member = memb;
                 }
-                if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
+                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                     vectorcalloffset_member = memb;
                 }
             }