Skip to content

Commit

Permalink
Docs for internal functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sffc authored Dec 4, 2023
1 parent 7017868 commit 09b56c0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions experimental/zerotrie/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,11 @@ pub fn get_phf_extended(mut trie: &[u8], mut ascii: &[u8]) -> Option<usize> {
}
}

/// Steps one node into the trie assuming all branch nodes are binary search and that
/// there are no span nodes.
///
/// The input-output argument `trie` starts at the original trie and ends pointing to
/// the sub-trie reachable by `c`.
pub(crate) fn step_bsearch_only(trie: &mut &[u8], c: u8) {
let (mut b, x, search);
loop {
Expand Down Expand Up @@ -566,6 +571,11 @@ pub(crate) fn step_bsearch_only(trie: &mut &[u8], c: u8) {
};
}

/// Steps one node into the trie if the head node is a value node, returning the value.
/// If the head node is not a value node, no change is made.
///
/// The input-output argument `trie` starts at the original trie and ends pointing to
/// the sub-trie with the value node removed.
pub(crate) fn take_value(trie: &mut &[u8]) -> Option<usize> {
let (b, new_trie) = trie.split_first()?;
match byte_type(*b) {
Expand Down

0 comments on commit 09b56c0

Please sign in to comment.