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

Function i64_ordering

nodedb/src/engine/kv/sorted_index/key.rs:162–176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

160
161 #[test]
162 fn i64_ordering() {
163 let values = [i64::MIN, -1000, -1, 0, 1, 1000, i64::MAX];
164 let encoded: Vec<_> = values
165 .iter()
166 .map(|v| SortKeyEncoder::encode_i64(*v))
167 .collect();
168 for i in 0..encoded.len() - 1 {
169 assert!(
170 encoded[i] < encoded[i + 1],
171 "encode_i64({}) should be < encode_i64({})",
172 values[i],
173 values[i + 1]
174 );
175 }
176 }
177
178 #[test]
179 fn f64_roundtrip() {

Callers

nothing calls this directly

Calls 4

encode_i64Function · 0.85
collectMethod · 0.80
iterMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected