Skip to content

Support query_single via conflict_resolution#19

Merged
nixonyh merged 5 commits intomainfrom
nixon/query-single
Feb 9, 2026
Merged

Support query_single via conflict_resolution#19
nixonyh merged 5 commits intomainfrom
nixon/query-single

Conversation

@nixonyh
Copy link
Member

@nixonyh nixonyh commented Feb 6, 2026

This is a stepping stone for #17

@nixonyh nixonyh enabled auto-merge (squash) February 6, 2026 02:11
@nixonyh nixonyh requested review from Sheerwin02 and ian-hon February 6, 2026 02:14
Comment on lines 159 to 166
if self.nodes.is_empty() {
// There's no tree, if there's just one rect, do a hit
// test for it.
if let Some(rect) = self.rects.first()
&& hit_condition(rect, &target)
{
hits.push(RectId(0));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it have case more than one rect before build?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only happen if the build function is not being called. In that case, querying is invalid anyways xd. This is because internal nodes are always N-1 (as defined in the algo)

Now that you mention this, I can make a follow up PR to create a spatree builder to ensure correctness.

Copy link
Contributor

@Sheerwin02 Sheerwin02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good!

@nixonyh nixonyh merged commit 99e94bd into main Feb 9, 2026
7 checks passed
@nixonyh nixonyh deleted the nixon/query-single branch February 9, 2026 06:10
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.

2 participants