reused cidset across all walks when flushing pending writes
This commit is contained in:
parent
1d41e1544a
commit
484dfaebce
@ -593,6 +593,7 @@ func (s *SplitStore) flushPendingWrites(locked bool) {
|
|||||||
|
|
||||||
cids := make([]cid.Cid, 0, len(s.pendingWrites))
|
cids := make([]cid.Cid, 0, len(s.pendingWrites))
|
||||||
seen := make(map[cid.Cid]struct{})
|
seen := make(map[cid.Cid]struct{})
|
||||||
|
walked := cid.NewSet()
|
||||||
for c := range s.pendingWrites {
|
for c := range s.pendingWrites {
|
||||||
_, ok := seen[c]
|
_, ok := seen[c]
|
||||||
if ok {
|
if ok {
|
||||||
@ -607,7 +608,7 @@ func (s *SplitStore) flushPendingWrites(locked bool) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
err := s.walkLinks(c, cid.NewSet(), func(c cid.Cid) error {
|
err := s.walkLinks(c, walked, func(c cid.Cid) error {
|
||||||
_, ok := seen[c]
|
_, ok := seen[c]
|
||||||
if !ok {
|
if !ok {
|
||||||
cids = append(cids, c)
|
cids = append(cids, c)
|
||||||
|
Loading…
Reference in New Issue
Block a user