From 15b6a0dc19fd7799d4e8d4d8fd78d4b7990d10f5 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 5 Jan 2024 06:12:52 -0500 Subject: [PATCH] refactor: change FileReference.DecodeMsgpack to just directly decode history, as it has its own deser --- metadata/file_reference.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/metadata/file_reference.go b/metadata/file_reference.go index e8ef69e..eeeca8c 100644 --- a/metadata/file_reference.go +++ b/metadata/file_reference.go @@ -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 }