HomeFreeBSD

radix_trie: skip compare in lookup_le, lookup_ge

Description

radix_trie: skip compare in lookup_le, lookup_ge

In _lookup_ge, where a loop "looks for an available edge or val within
the current bisection node" (to quote the code comment), the value of
index has already been modified to guarantee that it is the least
value than can be found in the non-NULL child node being
examined. Therefore, if the non-NULL child is a leaf, there's no need
to compare 'index' to anything, and the value can just be returned.

The same is true for _lookup_le with 'most' replacing 'least'.
Reviewed by: alc
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D40746

Details

Provenance
dougmAuthored on Jun 27 2023, 5:42 AM
Reviewer
alc
Differential Revision
D40746: radix_trie: skip needless compare in lookup_le, lookup_ge
Parents
rGd8e6f4946cec: vm: Fix anonymous memory clustering under ASLR
Branches
Unknown
Tags
Unknown