From ef6b46cdfe9f7b015a4e7e9d4734027bcfe84e1a Mon Sep 17 00:00:00 2001 From: Ben Brooks Date: Tue, 9 Jan 2024 11:52:18 +0000 Subject: [PATCH] Fix duplicate UnmarshalJSON func for SyncData --- db/document.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/db/document.go b/db/document.go index 27688176a1..d168ed4ba4 100644 --- a/db/document.go +++ b/db/document.go @@ -98,25 +98,6 @@ type SyncData struct { currentRevChannels base.Set // A base.Set of the current revision's channels (determined by SyncData.Channels at UnmarshalJSON time) } -func (sd *SyncData) UnmarshalJSON(b []byte) error { - - // type alias avoids UnmarshalJSON stack overflow (forces fallback to standard JSON unmarshal instead of this one) - type stdSyncData SyncData - var tmp stdSyncData - - err := base.JSONUnmarshal(b, &tmp) - if err != nil { - return err - } - - *sd = SyncData(tmp) - - // determine current revision's channels and store in-memory (avoids Channels iteration at access-check time) - sd.currentRevChannels = sd.getCurrentChannels() - - return nil -} - // determine set of current channels based on removal entries. func (sd *SyncData) getCurrentChannels() base.Set { ch := base.SetOf()