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

Function sort_children_by_axis

nodedb-spatial/src/rtree/split.rs:222–236  ·  view source on GitHub ↗
(children: &mut [ChildRef], axis: usize)

Source from the content-addressed store, hash-verified

220}
221
222fn sort_children_by_axis(children: &mut [ChildRef], axis: usize) {
223 children.sort_by(|a, b| {
224 let va = if axis == 0 {
225 a.bbox.min_lng
226 } else {
227 a.bbox.min_lat
228 };
229 let vb = if axis == 0 {
230 b.bbox.min_lng
231 } else {
232 b.bbox.min_lat
233 };
234 va.partial_cmp(&vb).unwrap_or(std::cmp::Ordering::Equal)
235 });
236}

Callers 2

split_internal_childrenFunction · 0.85

Calls 1

partial_cmpMethod · 0.45

Tested by

no test coverage detected