mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
Simplify interp_look_up_id() (#134257)
Don't use PyInterpreterState_GetID() but get directly the interpreter 'id' member which cannot fail.
This commit is contained in:
parent
71c42b778d
commit
e79f640eb6
1 changed files with 2 additions and 4 deletions
|
@ -1393,10 +1393,8 @@ interp_look_up_id(_PyRuntimeState *runtime, int64_t requested_id)
|
|||
{
|
||||
PyInterpreterState *interp = runtime->interpreters.head;
|
||||
while (interp != NULL) {
|
||||
int64_t id = PyInterpreterState_GetID(interp);
|
||||
if (id < 0) {
|
||||
return NULL;
|
||||
}
|
||||
int64_t id = interp->id;
|
||||
assert(id >= 0);
|
||||
if (requested_id == id) {
|
||||
return interp;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue