rlp: save one line

This commit is contained in:
Felix Lange 2019-09-12 17:29:00 +02:00
parent 2d98862cd7
commit 44ca09e90a

View file

@ -450,11 +450,10 @@ func makeNilPtrDecoder(etype reflect.Type, etypeinfo *typeinfo, nilKind Kind) de
// Handle empty values as a nil pointer. // Handle empty values as a nil pointer.
if kind != Byte && size == 0 { if kind != Byte && size == 0 {
if kind != nilKind { if kind != nilKind {
err := &decodeError{ return &decodeError{
msg: fmt.Sprintf("wrong kind of empty value (got %v, want %v)", kind, nilKind), msg: fmt.Sprintf("wrong kind of empty value (got %v, want %v)", kind, nilKind),
typ: typ, typ: typ,
} }
return err
} }
// rearm s.Kind. This is important because the input // rearm s.Kind. This is important because the input
// position must advance to the next value even though // position must advance to the next value even though