mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-27 04:32:16 +03:00
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:
@@ -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));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user