Commit a3be381 1 parent f4ac548 commit a3be381 Copy full SHA for a3be381
File tree 1 file changed +4
-7
lines changed
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -224,8 +224,7 @@ const (
224
224
SELFDESTRUCT OpCode = 0xff
225
225
)
226
226
227
- // Since the opcodes aren't all in order we can't use a regular slice.
228
- var opCodeToString = map [OpCode ]string {
227
+ var opCodeToString = [256 ]string {
229
228
// 0x0 range - arithmetic ops.
230
229
STOP : "STOP" ,
231
230
ADD : "ADD" ,
@@ -399,12 +398,10 @@ var opCodeToString = map[OpCode]string{
399
398
}
400
399
401
400
func (op OpCode ) String () string {
402
- str := opCodeToString [op ]
403
- if len (str ) == 0 {
404
- return fmt .Sprintf ("opcode %#x not defined" , int (op ))
401
+ if s := opCodeToString [op ]; s != "" {
402
+ return s
405
403
}
406
-
407
- return str
404
+ return fmt .Sprintf ("opcode %#x not defined" , int (op ))
408
405
}
409
406
410
407
var stringToOp = map [string ]OpCode {
You can’t perform that action at this time.
0 commit comments