HomeFreeBSD

pctrie: leave iter at root after ge_lookup failure

Description

pctrie: leave iter at root after ge_lookup failure

If pctrie_lookup_iter_ge fails to return a node, the iterator is left
with NULL as the current node. Instead, make the pctrie_root the
current node when the pctrie has an internalnode. Do the same thing
for lookup_iter_le. If an iterator is reused after a ge/le lookup
fails, this will skip the step in _pctrie_lookup_node where a NULL is
replaced by the node at the top of the trie.

Reviewed by: alc
Differential Revision: https://reviews.freebsd.org/D51232

Details

Provenance
dougmAuthored on Jul 10 2025, 8:14 AM
Reviewer
alc
Differential Revision
D51232: pctrie: leave pctrie top as current after [gl]e_lookup failure
Parents
rG78935fa40eee: named_attribute.7: typo fix
Branches
Unknown
Tags
Unknown