Commit 7ebaa437 authored by Todd Neal's avatar Todd Neal Committed by Brad Fitzpatrick

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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent acb47657
......@@ -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()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment