summaryrefslogtreecommitdiffstats
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index e1c73ab..839fac3 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -1390,13 +1390,10 @@ dummy_func(
// stack effect: (__array[oparg] -- __0)
inst(BUILD_LIST) {
- PyObject *list = PyList_New(oparg);
+ STACK_SHRINK(oparg);
+ PyObject *list = _PyList_FromArraySteal(stack_pointer, oparg);
if (list == NULL)
goto error;
- while (--oparg >= 0) {
- PyObject *item = POP();
- PyList_SET_ITEM(list, oparg, item);
- }
PUSH(list);
}