Skip to content

Commit

Permalink
PR FIXUP - Tweak currentKV
Browse files Browse the repository at this point in the history
Is technically more correct, and unlikely to have a meaningful impact on performance
  • Loading branch information
AndrewSisley committed Dec 12, 2024
1 parent 79a5013 commit 0d096c1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions internal/db/fetcher/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,13 @@ func (f *documentFetcher) NextDoc() (immutable.Option[string], error) {
return immutable.None[string](), err
}

if dsKey.DocID != f.currentKV.Key.DocID {
f.currentKV = keyValue{
Key: dsKey,
Value: res.Value,
}
previousKV := f.currentKV
f.currentKV = keyValue{
Key: dsKey,
Value: res.Value,
}

if dsKey.DocID != previousKV.Key.DocID {
break
}
}
Expand Down

0 comments on commit 0d096c1

Please sign in to comment.