From: Daniel Martí Date: Sun, 5 Mar 2017 13:04:56 +0000 (+0100) Subject: encoding/gob: remove unused ut and atyp parameters X-Git-Tag: go1.9beta1~1287 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0332b6cf589a51f421a88176f756f0315c9f1491;p=gostls13.git encoding/gob: remove unused ut and atyp parameters Found by github.com/mvdan/unparam. Change-Id: Ic97f05a2ecb5b17caa36aafe403e2266abea3e0e Reviewed-on: https://go-review.googlesource.com/37836 Run-TryBot: Rob Pike TryBot-Result: Gobot Gobot Reviewed-by: Rob Pike --- diff --git a/src/encoding/gob/decode.go b/src/encoding/gob/decode.go index 9645dc5790..792c159ded 100644 --- a/src/encoding/gob/decode.go +++ b/src/encoding/gob/decode.go @@ -430,7 +430,7 @@ type decEngine struct { // decodeSingle decodes a top-level value that is not a struct and stores it in value. // Such values are preceded by a zero, making them have the memory layout of a // struct field (although with an illegal field number). -func (dec *Decoder) decodeSingle(engine *decEngine, ut *userTypeInfo, value reflect.Value) { +func (dec *Decoder) decodeSingle(engine *decEngine, value reflect.Value) { state := dec.newDecoderState(&dec.buf) defer dec.freeDecoderState(state) state.fieldnum = singletonField @@ -446,7 +446,7 @@ func (dec *Decoder) decodeSingle(engine *decEngine, ut *userTypeInfo, value refl // differ from ut.indir, which was computed when the engine was built. // This state cannot arise for decodeSingle, which is called directly // from the user's value, not from the innards of an engine. -func (dec *Decoder) decodeStruct(engine *decEngine, ut *userTypeInfo, value reflect.Value) { +func (dec *Decoder) decodeStruct(engine *decEngine, value reflect.Value) { state := dec.newDecoderState(&dec.buf) defer dec.freeDecoderState(state) state.fieldnum = -1 @@ -538,7 +538,7 @@ func (dec *Decoder) decodeArrayHelper(state *decoderState, value reflect.Value, // decodeArray decodes an array and stores it in value. // The length is an unsigned integer preceding the elements. Even though the length is redundant // (it's part of the type), it's a useful check and is included in the encoding. -func (dec *Decoder) decodeArray(atyp reflect.Type, state *decoderState, value reflect.Value, elemOp decOp, length int, ovfl error, helper decHelper) { +func (dec *Decoder) decodeArray(state *decoderState, value reflect.Value, elemOp decOp, length int, ovfl error, helper decHelper) { if n := state.decodeUint(); n != uint64(length) { errorf("length mismatch in decodeArray") } @@ -813,7 +813,7 @@ func (dec *Decoder) decOpFor(wireId typeId, rt reflect.Type, name string, inProg ovfl := overflow(name) helper := decArrayHelper[t.Elem().Kind()] op = func(i *decInstr, state *decoderState, value reflect.Value) { - state.dec.decodeArray(t, state, value, *elemOp, t.Len(), ovfl, helper) + state.dec.decodeArray(state, value, *elemOp, t.Len(), ovfl, helper) } case reflect.Map: @@ -854,7 +854,7 @@ func (dec *Decoder) decOpFor(wireId typeId, rt reflect.Type, name string, inProg } op = func(i *decInstr, state *decoderState, value reflect.Value) { // indirect through enginePtr to delay evaluation for recursive structs. - dec.decodeStruct(*enginePtr, ut, value) + dec.decodeStruct(*enginePtr, value) } case reflect.Interface: op = func(i *decInstr, state *decoderState, value reflect.Value) { @@ -1197,9 +1197,9 @@ func (dec *Decoder) decodeValue(wireId typeId, value reflect.Value) { name := base.Name() errorf("type mismatch: no fields matched compiling decoder for %s", name) } - dec.decodeStruct(engine, ut, value) + dec.decodeStruct(engine, value) } else { - dec.decodeSingle(engine, ut, value) + dec.decodeSingle(engine, value) } }