]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/gob: remove always false comparison
authorTodd Neal <todd@tneal.org>
Mon, 24 Aug 2015 23:30:53 +0000 (18:30 -0500)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 25 Aug 2015 00:14:45 +0000 (00:14 +0000)
This is not a functional change. nr is a uint64 and can never be less
than zero, remove the no-op comparison.

Fixes #11279

Change-Id: Iebb36cc8fe97428b503e65d01b5e67d2b2bc7369
Reviewed-on: https://go-review.googlesource.com/13876
Run-TryBot: Todd Neal <todd@tneal.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/encoding/gob/decode.go

index e913f15c545a240cc0760cd681fcc10af9664653..ef536b32b2910c5269e5c225b6c163b446f4a975 100644 (file)
@@ -634,7 +634,7 @@ func (dec *Decoder) ignoreSlice(state *decoderState, elemOp decOp) {
 func (dec *Decoder) decodeInterface(ityp reflect.Type, state *decoderState, value reflect.Value) {
        // Read the name of the concrete type.
        nr := state.decodeUint()
-       if nr < 0 || nr > 1<<31 { // zero is permissible for anonymous types
+       if nr > 1<<31 { // zero is permissible for anonymous types
                errorf("invalid type name length %d", nr)
        }
        if nr > uint64(state.b.Len()) {