https://github.com/python/cpython/commit/8c9c6d3c1234e730c0beb2a6123e68fe98e57ede
commit: 8c9c6d3c1234e730c0beb2a6123e68fe98e57ede
branch: main
author: neonene <[email protected]>
committer: encukou <[email protected]>
date: 2024-11-13T17:09:26Z
summary:
gh-123465: Ensure PyType_FromMetaclass avoids extra strcmp (GH-125460)
use else
files:
M Objects/typeobject.c
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 4af7f0273aae91..a6cf3da542b691 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -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;
}
}
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]