Skip to content

Commit 519cf98

Browse files
authored
core/vm: simplify op lookup in contract (ethereum#23974)
1 parent 4ebeca1 commit 519cf98

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

core/vm/contract.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,11 @@ func (c *Contract) AsDelegate() *Contract {
143143

144144
// GetOp returns the n'th element in the contract's byte array
145145
func (c *Contract) GetOp(n uint64) OpCode {
146-
return OpCode(c.GetByte(n))
147-
}
148-
149-
// GetByte returns the n'th byte in the contract's byte array
150-
func (c *Contract) GetByte(n uint64) byte {
151146
if n < uint64(len(c.Code)) {
152-
return c.Code[n]
147+
return OpCode(c.Code[n])
153148
}
154149

155-
return 0
150+
return STOP
156151
}
157152

158153
// Caller returns the caller of the contract.

0 commit comments

Comments
 (0)