MCPcopy Create free account
hub / github.com/douchuan/algorithm / get_dth

Function get_dth

src/strings/tries.rs:197–207  ·  view source on GitHub ↗
(x: Option<NonNull<Node<T>>>, key: &str, d: usize)

Source from the content-addressed store, hash-verified

195}
196
197fn get_dth<T>(x: Option<NonNull<Node<T>>>, key: &str, d: usize) -> Option<NonNull<Node<T>>> {
198 x.and_then(|x| {
199 if d == key.len() {
200 Some(x)
201 } else {
202 let i = common::util::byte_at(key, d);
203 let next = unsafe { x.as_ref().next[i] };
204 get_dth(next, key, d + 1)
205 }
206 })
207}
208
209unsafe fn collect_prefix<T>(
210 x: Option<NonNull<Node<T>>>,

Callers 2

getMethod · 0.70
keys_with_prefixMethod · 0.70

Calls 2

byte_atFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected