Skip to content

Commit

Permalink
Refactor keysDistance -> editDistance
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavdangeti committed Nov 20, 2024
1 parent 1b5a456 commit 6d8c9a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fst_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type FSTIterator struct {

nextStart []byte

keysDistance uint8
editDistance uint8
}

func newIterator(f *FST, startKeyInclusive, endKeyExclusive []byte,
Expand All @@ -82,7 +82,7 @@ func newIterator(f *FST, startKeyInclusive, endKeyExclusive []byte,
}

func (i *FSTIterator) EditDistance() uint8 {
return i.keysDistance
return i.editDistance
}

// Reset resets the Iterator' internal state to allow for iterator
Expand Down Expand Up @@ -218,7 +218,7 @@ OUTER:
cmp := bytes.Compare(i.keysStack, i.nextStart)
if cmp > 0 {
if fa, ok := i.aut.(FuzzyAutomaton); ok {
i.keysDistance = fa.EditDistance(autCurr)
i.editDistance = fa.EditDistance(autCurr)
}
// in final state greater than start key
return nil
Expand Down

0 comments on commit 6d8c9a4

Please sign in to comment.