Skip to content

Commit

Permalink
walk doc cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: redwrasse <[email protected]>
  • Loading branch information
redwrasse committed Sep 17, 2023
1 parent 9ec5f98 commit d5c888c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions server/storage/mvcc/key_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,10 @@ type generation struct {

func (g *generation) isEmpty() bool { return g == nil || len(g.revs) == 0 }

// walk walks through the revisions in the generation in descending order.
// It passes the revision to the given function.
// walk returns until: 1. it finishes walking all pairs 2. the function returns false.
// walk returns the position at where it stopped. If it stopped after
// finishing walking, -1 will be returned.
// walk traverses revisions in the generation in descending order,
// passing the current revision to the given function. It returns
// the first position where the given function returns false, or -1
// upon completing traversal.
func (g *generation) walk(f func(rev revision) bool) int {
l := len(g.revs)
for i := range g.revs {
Expand Down

0 comments on commit d5c888c

Please sign in to comment.