From b0a8f54776618a00b110d269394d0f588f4087fb Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 19 Nov 2021 22:25:14 +0300 Subject: [PATCH] vm: drop LoadArgs method, it's a Legacy remnant --- pkg/compiler/vm_test.go | 7 ++++++- pkg/vm/vm.go | 10 ---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/pkg/compiler/vm_test.go b/pkg/compiler/vm_test.go index 03f8655e0..73eed9e48 100644 --- a/pkg/compiler/vm_test.go +++ b/pkg/compiler/vm_test.go @@ -42,7 +42,12 @@ func eval(t *testing.T, src string, result interface{}) { func evalWithArgs(t *testing.T, src string, op []byte, args []stackitem.Item, result interface{}) { vm := vmAndCompile(t, src) - vm.LoadArgs(op, args) + if len(args) > 0 { + vm.Estack().PushVal(args) + } + if op != nil { + vm.Estack().PushVal(op) + } err := vm.Run() require.NoError(t, err) assert.Equal(t, 1, vm.Estack().Len(), "stack contains unexpected items") diff --git a/pkg/vm/vm.go b/pkg/vm/vm.go index 17f01176e..dc730495f 100644 --- a/pkg/vm/vm.go +++ b/pkg/vm/vm.go @@ -133,16 +133,6 @@ func (v *VM) Istack() *Stack { return &v.istack } -// LoadArgs loads in the arguments used in the Mian entry point. -func (v *VM) LoadArgs(method []byte, args []stackitem.Item) { - if len(args) > 0 { - v.estack.PushVal(args) - } - if method != nil { - v.estack.PushVal(method) - } -} - // PrintOps prints the opcodes of the current loaded program to stdout. func (v *VM) PrintOps(out io.Writer) { if out == nil {