This patch introduces TRUE Iterator which efficiently handles posting lists containing all items within [0, Size) range.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang-tools-extra/clangd/index/dex/Iterator.cpp | ||
---|---|---|
230 ↗ | (On Diff #161430) | nit: The documentation here is a bit verbose as. How about ... It stores size of the virtual posting list, and all operations are performed in O(1).? Other statements can be easily derived from this IMO. |
248 ↗ | (On Diff #161430) | Should we check ID < Size here? |
258 ↗ | (On Diff #161430) | nit: maybe s/TrueIterator/TRUE/? |
Address a couple of comments.
clang-tools-extra/clangd/index/dex/Iterator.cpp | ||
---|---|---|
248 ↗ | (On Diff #161430) | Not really, here's an example: (& ({0}, 42) (TRUE {0} out of 10). When called advance(), underlying AND iterator would point to 42 and advanceTo() would be called on TRUE iterator, it will move it to the END but it would be completely valid (same behavior for every iterator, actually, since none of them check for ID < LastDocID equivalent). I should, however, do Index = std::min(ID, Size) since calling dump() and getting something like (TRUE {9000} out of 42) would be implicit. |