aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/gob/decode.go
diff options
context:
space:
mode:
authorTodd Neal <todd@tneal.org>2015-08-24 18:30:53 -0500
committerBrad Fitzpatrick <bradfitz@golang.org>2015-08-25 00:14:45 +0000
commit7ebaa43754872d4da1f58e8fbd2d2db077af5f0f (patch)
tree7cfc919243fb3178fb3824aa2bdc2cac9f3c9359 /src/encoding/gob/decode.go
parentacb47657096a728d10b33f2949b5a52ef5226b9d (diff)
downloadgo-7ebaa43754872d4da1f58e8fbd2d2db077af5f0f.tar.gz
go-7ebaa43754872d4da1f58e8fbd2d2db077af5f0f.zip
encoding/gob: remove always false comparison
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>
Diffstat (limited to 'src/encoding/gob/decode.go')
-rw-r--r--src/encoding/gob/decode.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/encoding/gob/decode.go b/src/encoding/gob/decode.go
index e913f15c54..ef536b32b2 100644
--- a/src/encoding/gob/decode.go
+++ b/src/encoding/gob/decode.go
@@ -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()) {