Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 2f8574e

Browse files
committed
remove switchToBasic fixme
1 parent 7d338e3 commit 2f8574e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

io/directory.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -415,15 +415,12 @@ func (d *HAMTDirectory) switchToBasic(ctx context.Context) (*BasicDirectory, err
415415
}
416416

417417
return nil
418+
// This function enumerates all the links in the Directory requiring all
419+
// shards to be accessible but it is only called *after* sizeBelowThreshold
420+
// returns true, which means we have already enumerated and fetched *all*
421+
// shards in the first place (that's the only way we can be really sure
422+
// we are actually below the threshold).
418423
})
419-
// FIXME: The above was adapted from SwitchToSharding. We can probably optimize:
420-
// 2. Do not enumerate all link from scratch (harder than previous
421-
// item). We call this function only from the UpgradeableDirectory
422-
// when we went below the threshold: the detection will be done through
423-
// (partial) enumeration. We may be able to reuse some of that work
424-
// (likely retaining the links in a cache). (All this is uncertain
425-
// at this point as we don't know how partial enumeration will be
426-
// implemented.)
427424

428425
return basicDir, nil
429426
}

0 commit comments

Comments
 (0)