diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-01-19 17:59:35 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-01-19 17:59:35 +0800 |
commit | 06bfe19f05b2a961a458cada69c72c809354f53f (patch) | |
tree | a6abe9d9b8df19823014eb6bfd5021af3ef67cc1 /rlp/encode.go | |
parent | 7394ee7c725a3db2efbe2cd2c01cd16312be6026 (diff) | |
parent | fc92abec2cc6e27e7e56a6a05850ad4ebbf63d7e (diff) | |
download | go-tangerine-06bfe19f05b2a961a458cada69c72c809354f53f.tar go-tangerine-06bfe19f05b2a961a458cada69c72c809354f53f.tar.gz go-tangerine-06bfe19f05b2a961a458cada69c72c809354f53f.tar.bz2 go-tangerine-06bfe19f05b2a961a458cada69c72c809354f53f.tar.lz go-tangerine-06bfe19f05b2a961a458cada69c72c809354f53f.tar.xz go-tangerine-06bfe19f05b2a961a458cada69c72c809354f53f.tar.zst go-tangerine-06bfe19f05b2a961a458cada69c72c809354f53f.zip |
Merge pull request #260 from fjl/rlp-encoder
rlp: allow encoding non-empty interface values
Diffstat (limited to 'rlp/encode.go')
-rw-r--r-- | rlp/encode.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/rlp/encode.go b/rlp/encode.go index 689d25dd8..d80b66315 100644 --- a/rlp/encode.go +++ b/rlp/encode.go @@ -280,7 +280,6 @@ func (r *encReader) next() []byte { var ( encoderInterface = reflect.TypeOf(new(Encoder)).Elem() - emptyInterface = reflect.TypeOf(new(interface{})).Elem() big0 = big.NewInt(0) ) @@ -292,7 +291,7 @@ func makeWriter(typ reflect.Type) (writer, error) { return writeEncoder, nil case kind != reflect.Ptr && reflect.PtrTo(typ).Implements(encoderInterface): return writeEncoderNoPtr, nil - case typ == emptyInterface: + case kind == reflect.Interface: return writeInterface, nil case typ.AssignableTo(reflect.PtrTo(bigInt)): return writeBigIntPtr, nil |