diff options
author | Ken Jin <kenjin@python.org> | 2022-12-09 18:27:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-09 10:27:01 +0000 |
commit | 748c6c0921ee02a19e01a35f03ce5f4d9cfde5a6 (patch) | |
tree | df269e2c07729851f0f02e77713c140c0db15064 /Python/specialize.c | |
parent | 0448deac70be94792616c0fb0c9cb524de9a09b8 (diff) | |
download | cpython-git-748c6c0921ee02a19e01a35f03ce5f4d9cfde5a6.tar.gz |
GH-100110: Specialize FOR_ITER for tuples (GH-100109)
* Specialize FOR_ITER for tuples
Diffstat (limited to 'Python/specialize.c')
-rw-r--r-- | Python/specialize.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/specialize.c b/Python/specialize.c index cd09b188b7..7545a77124 100644 --- a/Python/specialize.c +++ b/Python/specialize.c @@ -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; |