mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
gh-117139: Add _PyTuple_FromStackRefSteal and use it (#121244)
Avoids the extra conversion from stack refs to PyObjects.
This commit is contained in:
parent
1ac273224a
commit
8e8d202f55
8 changed files with 28 additions and 33 deletions
|
@ -1780,13 +1780,7 @@ dummy_func(
|
|||
}
|
||||
|
||||
inst(BUILD_TUPLE, (values[oparg] -- tup)) {
|
||||
STACKREFS_TO_PYOBJECTS(values, oparg, values_o);
|
||||
if (CONVERSION_FAILED(values_o)) {
|
||||
DECREF_INPUTS();
|
||||
ERROR_IF(true, error);
|
||||
}
|
||||
PyObject *tup_o = _PyTuple_FromArraySteal(values_o, oparg);
|
||||
STACKREFS_TO_PYOBJECTS_CLEANUP(values_o);
|
||||
PyObject *tup_o = _PyTuple_FromStackRefSteal(values, oparg);
|
||||
ERROR_IF(tup_o == NULL, error);
|
||||
tup = PyStackRef_FromPyObjectSteal(tup_o);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue