-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed as not planned
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
In listobject.c
there is an optimization to check whether an index is valid (e.g. 0 <= index < N
) using a single comparison. The same optimization is not used in other files such as tupleobject.c
.
By replacing index checks with a single macro that includes the optimization we have consistency in the code and have the optimized check for all index checks.
Previous discussion
Idea first mentioned at faster-cpython/ideas#498
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement