refactor: change FileReference.DecodeMsgpack to just directly decode history, as it has its own deser

This commit is contained in:
Derrick Hammer 2024-01-05 06:12:52 -05:00
parent 0e2ef0969a
commit 15b6a0dc19
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 13 deletions

View File

@ -120,22 +120,10 @@ func (fr *FileReference) DecodeMsgpack(dec *msgpack.Decoder) error {
hasExt = true
case int8(8):
historyDataLen, err := dec.DecodeMapLen()
err := dec.Decode(&fr.History)
if err != nil {
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
}