Skip to content

Commit fa6d0ed

Browse files
committed
Skip ChannelsMap storage on Marshal for the winning revision (it's stored elsewhere outside of the RevTree)
1 parent dfd3fd8 commit fa6d0ed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

db/revtree.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ func (tree RevTree) MarshalJSON() ([]byte, error) {
6363
}
6464
revIndexes := map[string]int{"": -1}
6565

66+
winner, _, _ := tree.winningRevision()
67+
6668
i := 0
6769
for _, info := range tree {
6870
revIndexes[info.ID] = i
@@ -84,7 +86,7 @@ func (tree RevTree) MarshalJSON() ([]byte, error) {
8486
}
8587

8688
// for non-winning leaf revisions we'll store channel information
87-
if len(info.Channels) > 0 {
89+
if winner != info.ID && len(info.Channels) > 0 {
8890
if rep.ChannelsMap == nil {
8991
rep.ChannelsMap = make(map[string]base.Set, 1)
9092
}

0 commit comments

Comments
 (0)