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

Function sort_entries_by_axis

nodedb-spatial/src/rtree/split.rs:206–220  ·  view source on GitHub ↗
(entries: &mut [RTreeEntry], axis: usize)

Source from the content-addressed store, hash-verified

204}
205
206fn sort_entries_by_axis(entries: &mut [RTreeEntry], axis: usize) {
207 entries.sort_by(|a, b| {
208 let va = if axis == 0 {
209 a.bbox.min_lng
210 } else {
211 a.bbox.min_lat
212 };
213 let vb = if axis == 0 {
214 b.bbox.min_lng
215 } else {
216 b.bbox.min_lat
217 };
218 va.partial_cmp(&vb).unwrap_or(std::cmp::Ordering::Equal)
219 });
220}
221
222fn sort_children_by_axis(children: &mut [ChildRef], axis: usize) {
223 children.sort_by(|a, b| {

Callers 2

split_leaf_entriesFunction · 0.85
choose_best_axis_leafFunction · 0.85

Calls 1

partial_cmpMethod · 0.45

Tested by

no test coverage detected