MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / extend

Method extend

nodedb-array/src/segment/mbr_index/node.rs:34–47  ·  view source on GitHub ↗

Union `self` with `other` in-place. Empty boxes (arity 0) are ignored — callers seed leaves with concrete MBRs.

(&mut self, other: &BBox)

Source from the content-addressed store, hash-verified

32 /// Union `self` with `other` in-place. Empty boxes (arity 0) are
33 /// ignored — callers seed leaves with concrete MBRs.
34 pub fn extend(&mut self, other: &BBox) {
35 if self.arity() == 0 {
36 *self = other.clone();
37 return;
38 }
39 for i in 0..self.arity().min(other.arity()) {
40 if super::predicate::lt_bound(&other.min[i], &self.min[i]) {
41 self.min[i] = other.min[i].clone();
42 }
43 if super::predicate::lt_bound(&self.max[i], &other.max[i]) {
44 self.max[i] = other.max[i].clone();
45 }
46 }
47 }
48}
49
50/// One node in the Hilbert-packed R-tree.

Callers 5

buildMethod · 0.45
chunk_bboxFunction · 0.45
bbox_extend_grows_boundsFunction · 0.45
mixed_runs_roundtripFunction · 0.45

Calls 3

lt_boundFunction · 0.85
arityMethod · 0.45
cloneMethod · 0.45

Tested by 3

bbox_extend_grows_boundsFunction · 0.36
mixed_runs_roundtripFunction · 0.36