mirror of
https://github.com/python/cpython.git
synced 2025-10-06 15:11:58 +00:00
GH-100110: Specialize FOR_ITER for tuples (GH-100109)
* Specialize FOR_ITER for tuples
This commit is contained in:
parent
0448deac70
commit
748c6c0921
10 changed files with 122 additions and 67 deletions
|
@ -2132,6 +2132,10 @@ _Py_Specialize_ForIter(PyObject *iter, _Py_CODEUNIT *instr, int oparg)
|
|||
_Py_SET_OPCODE(*instr, FOR_ITER_LIST);
|
||||
goto success;
|
||||
}
|
||||
else if (tp == &PyTupleIter_Type) {
|
||||
_Py_SET_OPCODE(*instr, FOR_ITER_TUPLE);
|
||||
goto success;
|
||||
}
|
||||
else if (tp == &PyRangeIter_Type && next_op == STORE_FAST) {
|
||||
_Py_SET_OPCODE(*instr, FOR_ITER_RANGE);
|
||||
goto success;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue