vm: simplify some test code

gosimple: S1017: should replace this `if` statement with an unconditional `strings.TrimPrefix`
This commit is contained in:
Roman Khimov 2021-05-12 18:44:35 +03:00
parent 7af67d2a3c
commit de5e61588d

View file

@ -454,8 +454,6 @@ func decodeBytes(data []byte) ([]byte, error) {
}
func decodeHex(s string) ([]byte, error) {
if strings.HasPrefix(s, "0x") {
s = s[2:]
}
s = strings.TrimPrefix(s, "0x")
return hex.DecodeString(s)
}