Skip to content

Commit

Permalink
fix reverse iterator seekreverse lowerbound
Browse files Browse the repository at this point in the history
  • Loading branch information
absolutelightning committed Jun 13, 2024
1 parent cef7c10 commit 490c205
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions reverse_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ func (ri *ReverseIterator[T]) SeekReverseLowerBound(key []byte) {
idx = int(n.getNumChildren()) - 1
}

if idx >= 0 && n.getKeyAtIdx(idx) != prefix[depth] {
ri.i.seenMismatch = true
}

if ri.i.seenMismatch {
idx = int(n.getNumChildren()) - 1
}
Expand Down
2 changes: 0 additions & 2 deletions reverse_iterator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
)

func TestReverseIterator_SeekReverseLowerBoundFuzz(t *testing.T) {
t.Skip()
r := NewRadixTree[any]()
var set []string

Expand Down Expand Up @@ -69,7 +68,6 @@ func TestReverseIterator_SeekReverseLowerBoundFuzz(t *testing.T) {
}

func TestReverseIterator_SeekLowerBound(t *testing.T) {
t.Skip()

// these should be defined in order
var fixedLenKeys = []string{
Expand Down

0 comments on commit 490c205

Please sign in to comment.