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:
@@ -2616,11 +2616,8 @@ spa_name_compare(const void *a1, const void *a2)
|
||||
{
|
||||
const spa_t *s1 = a1;
|
||||
const spa_t *s2 = a2;
|
||||
int s;
|
||||
|
||||
s = strcmp(s1->spa_name, s2->spa_name);
|
||||
|
||||
return (TREE_ISIGN(s));
|
||||
return (TREE_ISIGN(strcmp(s1->spa_name, s2->spa_name)));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user