mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-21 20:10:17 +00:00
improve list.append
This commit is contained in:
parent
faad1d7067
commit
3cc481c50e
9
src/vm.h
9
src/vm.h
@ -118,12 +118,13 @@ private:
|
|||||||
frame->push(PyStr(ss.str()));
|
frame->push(PyStr(ss.str()));
|
||||||
} break;
|
} break;
|
||||||
case OP_LOAD_EVAL_FN: {
|
case OP_LOAD_EVAL_FN: {
|
||||||
frame->push(builtins->attribs["eval"]);
|
frame->push(builtins->attribs["eval"_c]);
|
||||||
} break;
|
} break;
|
||||||
case OP_LIST_APPEND: {
|
case OP_LIST_APPEND: {
|
||||||
PyVar obj = frame->popValue(this);
|
pkpy::ArgList args(2);
|
||||||
PyVar list = frame->__topValueN(this, -2);
|
args[1] = frame->popValue(this); // obj
|
||||||
fastCall(list, "append", {list, obj});
|
args[0] = frame->__topValueN(this, -2); // list
|
||||||
|
fastCall(args[0], "append"_c, std::move(args));
|
||||||
} break;
|
} break;
|
||||||
case OP_STORE_FUNCTION:
|
case OP_STORE_FUNCTION:
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user