From 0afaff2f79a8a5fc4b5793091a23b997cef9017f Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 13 Dec 2019 17:02:28 +0300 Subject: [PATCH] vm: microoptimize RegisterInteropFuncs() Avoid useless copying. --- pkg/vm/vm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/vm/vm.go b/pkg/vm/vm.go index 0b488f83f..5d784e83e 100644 --- a/pkg/vm/vm.go +++ b/pkg/vm/vm.go @@ -129,8 +129,8 @@ func (v *VM) RegisterInteropFunc(name string, f InteropFunc, price int) { // the VM. Effectively it's a batched version of RegisterInteropFunc. func (v *VM) RegisterInteropFuncs(interops map[string]InteropFuncPrice) { // We allow reregistration here. - for name, funPrice := range interops { - v.interop[name] = funPrice + for name := range interops { + v.interop[name] = interops[name] } }