Copilot commented on code in PR #513:
URL: https://github.com/apache/sedona-db/pull/513#discussion_r2690932300
##########
rust/sedona-spatial-join/src/partitioning/kdb.rs:
##########
@@ -165,33 +165,30 @@ impl KDBTree {
}
fn insert_rect(&mut self, rect: Rect<f32>) {
- if self.items.len() < self.max_items_per_node || self.level >=
self.max_levels {
- self.items.push(rect);
- } else {
- if self.children.is_none() {
- // Split over longer side
- let split_x = self.extent.width() > self.extent.height();
- let mut ok = self.split(split_x);
- if !ok {
- // Try splitting by the other side
- ok = self.split(!split_x);
- }
+ if self.children.is_none() {
+ if self.items.len() < self.max_items_per_node || self.level >=
self.max_levels {
+ // This leaf node has enough capacity, insert into it.
+ self.items.push(rect);
+ return;
+ }
- if !ok {
- // This could happen if all envelopes are the same.
- self.items.push(rect);
- return;
- }
+ // Try splitting over longer side. It it does not work, fallback
splitting
Review Comment:
Corrected spelling of 'It it' to 'If it'.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]