vm: microoptimize new estack creation
Subslice won't reach element -1, but it can reuse the same buffer space more effectively.
This commit is contained in:
parent
10110d4e70
commit
3d4076ca36
2 changed files with 9 additions and 1 deletions
|
@ -322,7 +322,7 @@ func (v *VM) loadScriptWithCallingHash(b []byte, exe *nef.File, caller util.Uint
|
|||
v.checkInvocationStackSize()
|
||||
ctx := NewContextWithParams(b, rvcount, offset)
|
||||
if rvcount != -1 || v.estack.Len() != 0 {
|
||||
v.estack = newStack("evaluation", &v.refs)
|
||||
v.estack = subStack(v.estack)
|
||||
}
|
||||
ctx.estack = v.estack
|
||||
initStack(&ctx.tryStack, "exception", nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue