Skip to content

Commit ba35ed2

Browse files
authored
Merge pull request #2012 from CortexFoundation/dev
core/vm: remove a redundant zero check in opAddmod
2 parents 96210aa + c05a295 commit ba35ed2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

core/vm/instructions.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,9 @@ func opByte(pc *uint64, interpreter *CVMInterpreter, callContext *ScopeContext)
184184
return nil, nil
185185
}
186186

187-
func opAddmod(pc *uint64, interpreter *CVMInterpreter, callContext *ScopeContext) ([]byte, error) {
188-
x, y, z := callContext.Stack.pop(), callContext.Stack.pop(), callContext.Stack.peek()
189-
if z.IsZero() {
190-
z.Clear()
191-
} else {
192-
z.AddMod(&x, &y, z)
193-
}
187+
func opAddmod(pc *uint64, interpreter *CVMInterpreter, scope *ScopeContext) ([]byte, error) {
188+
x, y, z := scope.Stack.pop(), scope.Stack.pop(), scope.Stack.peek()
189+
z.AddMod(&x, &y, z)
194190
return nil, nil
195191
}
196192

0 commit comments

Comments
 (0)