Skip to content

Commit

Permalink
Fix slice allocation size/capacity (#2598)
Browse files Browse the repository at this point in the history
The incorrectly allocated notFound slice nevertheless did not result in
an incorrect behaviour of SubtreeCache, because Flush would ignore
these tiles as not "dirty" and/or being empty. Hence this bug was not
caught by the tests. It doesn't need a regression test for the same reason.
  • Loading branch information
pav-kv authored Jul 27, 2021
1 parent 40ba8af commit e541826
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion storage/cache/subtree_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (s *SubtreeCache) preload(ids []compact.NodeID, getSubtrees GetSubtreesFunc
}
delete(want, string(t.Prefix))
}
notFound := make([]string, len(want))
notFound := make([]string, 0, len(want))
for id := range want {
notFound = append(notFound, id)
}
Expand Down

0 comments on commit e541826

Please sign in to comment.