Skip to content

Document the comparator contract of find, find_all and find_next_in_subtree - #70

Merged
5cript merged 2 commits into
masterfrom
docs/find-compare-pruning
Oct 24, 2026
Merged

5cript merged 2 commits into
masterfrom
docs/find-compare-pruning

Conversation

@5cript

@5cript 5cript commented Oct 24, 2026

Copy link
Copy Markdown
Owner

The comparator overloads skip subtrees whose max is below ival.high(), so a compare function that accepts an interval with a smaller high misses matches. That is now stated as a contract in the README and the doc comments: compare must never return true for an interval whose high is below ival.high().
For float comparisons, the README now says to lower the high of ival by the tolerance.

Adds tests for the comparator overloads within that contract, a float tolerance search, and the exact-match overloads (including that they still prune by max).

- Comparator tests keep to the contract that compare never accepts a high below ival.high().
- Exact-match tests check that those overloads find everything and prune by max.
@5cript
5cript merged commit 0b3fea9 into master Oct 24, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant