]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40137: Optimize _PyType_GetModuleByDef() loop (GH-25505)
authorVictor Stinner <vstinner@python.org>
Wed, 21 Apr 2021 22:10:16 +0000 (00:10 +0200)
committerGitHub <noreply@github.com>
Wed, 21 Apr 2021 22:10:16 +0000 (00:10 +0200)
commit760da626ff4124e1344fd8b7dbeb83b2c4b7c12c
treeca3bf154f0d0b0aefc2d35710a0b05bba09ada9b
parentd4aaa34798f0dd8402f412e2aa9d6fa2d6cff5fa
bpo-40137: Optimize _PyType_GetModuleByDef() loop (GH-25505)

PyType_Ready() now ensures that a type MRO cannot be empty.

_PyType_GetModuleByDef() no longer checks "i < PyTuple_GET_SIZE(mro)"
at the first loop iteration to optimize the most common case, when
the argument is the defining class.
Objects/typeobject.c