More consistent use of TREE_* macros in AVL comparators

Where is it appropriate and obvious, use TREE_CMP(), TREE_ISIGN() and
TREE_PCMP() instead or direct comparisons. It can make the code a lot
smaller, less error prone, and easier to read.

Sponsored-by: TrueNAS
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@truenas.com>
Closes #18259
This commit is contained in:
Rob Norris
2026-03-04 04:08:23 +11:00
committed by GitHub
parent 0f90a797dd
commit 1e2c94a043
19 changed files with 88 additions and 199 deletions
+1 -9
View File
@@ -1213,15 +1213,7 @@ static int
acevals_compare(const void *va, const void *vb)
{
const acevals_t *a = va, *b = vb;
if (a->key == b->key)
return (0);
if (a->key > b->key)
return (1);
else
return (-1);
return (TREE_CMP(a->key, b->key));
}
/*