libzfs_sendrecv: Avoid extra avl_find
avl_add does avl_find internally, then avl_insert. We're already doing the avl_find, so using avl_insert directly avoids repeating the search. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes #12967
This commit is contained in:
parent
af1630c883
commit
ddb5a7a182
|
@ -206,8 +206,9 @@ fsavl_create(nvlist_t *fss)
|
||||||
* Note: if there are multiple snaps with the
|
* Note: if there are multiple snaps with the
|
||||||
* same GUID, we ignore all but one.
|
* same GUID, we ignore all but one.
|
||||||
*/
|
*/
|
||||||
if (avl_find(fsavl, fn, NULL) == NULL)
|
avl_index_t where = 0;
|
||||||
avl_add(fsavl, fn);
|
if (avl_find(fsavl, fn, &where) == NULL)
|
||||||
|
avl_insert(fsavl, fn, where);
|
||||||
else
|
else
|
||||||
free(fn);
|
free(fn);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue