diff options
author | Sam Gross <colesbury@gmail.com> | 2024-07-02 12:30:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-02 12:30:14 -0400 |
commit | 8e8d202f552c993f40913b628139a39a5abe6a03 (patch) | |
tree | a907d73519febe133d4b86f57f33908e241ff41a /Python/executor_cases.c.h | |
parent | 1ac273224a85126c4356e355f7445206fadde7ec (diff) | |
download | cpython-8e8d202f552c993f40913b628139a39a5abe6a03.tar.gz cpython-8e8d202f552c993f40913b628139a39a5abe6a03.zip |
gh-117139: Add _PyTuple_FromStackRefSteal and use it (#121244)
Avoids the extra conversion from stack refs to PyObjects.
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r-- | Python/executor_cases.c.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index d70a57a9a8f..3b999465aac 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -1816,15 +1816,7 @@ _PyStackRef tup; oparg = CURRENT_OPARG(); values = &stack_pointer[-oparg]; - STACKREFS_TO_PYOBJECTS(values, oparg, values_o); - if (CONVERSION_FAILED(values_o)) { - for (int _i = oparg; --_i >= 0;) { - PyStackRef_CLOSE(values[_i]); - } - if (true) JUMP_TO_ERROR(); - } - PyObject *tup_o = _PyTuple_FromArraySteal(values_o, oparg); - STACKREFS_TO_PYOBJECTS_CLEANUP(values_o); + PyObject *tup_o = _PyTuple_FromStackRefSteal(values, oparg); if (tup_o == NULL) JUMP_TO_ERROR(); tup = PyStackRef_FromPyObjectSteal(tup_o); stack_pointer[-oparg] = tup; |