refactor: change FileReference.DecodeMsgpack to just directly decode history, as it has its own deser
This commit is contained in:
parent
0e2ef0969a
commit
15b6a0dc19
|
@ -120,22 +120,10 @@ func (fr *FileReference) DecodeMsgpack(dec *msgpack.Decoder) error {
|
||||||
|
|
||||||
hasExt = true
|
hasExt = true
|
||||||
case int8(8):
|
case int8(8):
|
||||||
historyDataLen, err := dec.DecodeMapLen()
|
err := dec.Decode(&fr.History)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
fr.History = make(map[int]*FileVersion, historyDataLen)
|
|
||||||
for range fr.History {
|
|
||||||
k, err := dec.DecodeInt()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
var fileVersion FileVersion
|
|
||||||
err = dec.Decode(&fileVersion)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
hasHistory = true
|
hasHistory = true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue