mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +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:
@@ -90,8 +90,8 @@ static int
|
||||
kcf_mech_hash_compar(const void *lhs, const void *rhs)
|
||||
{
|
||||
const kcf_mech_entry_t *l = lhs, *r = rhs;
|
||||
int cmp = strncmp(l->me_name, r->me_name, CRYPTO_MAX_MECH_NAME);
|
||||
return ((0 < cmp) - (cmp < 0));
|
||||
return (TREE_ISIGN(strncmp(l->me_name, r->me_name,
|
||||
CRYPTO_MAX_MECH_NAME)));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user