From ea89f9adf0ace09c46e790bf8c38414f7b90af69 Mon Sep 17 00:00:00 2001 From: Aaron Chen Date: Tue, 30 Apr 2024 20:08:13 +0800 Subject: [PATCH] core/vm: remove a redundant zero check in opAddmod (#29672) --- core/vm/instructions.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/vm/instructions.go b/core/vm/instructions.go index a062bb15ff5c3..f37ee004dc3a1 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -173,11 +173,7 @@ func opByte(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byt func opAddmod(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) { x, y, z := scope.Stack.pop(), scope.Stack.pop(), scope.Stack.peek() - if z.IsZero() { - z.Clear() - } else { - z.AddMod(&x, &y, z) - } + z.AddMod(&x, &y, z) return nil, nil }