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
1488e822f2
commit
af2b1fbda6
|
@ -204,8 +204,9 @@ fsavl_create(nvlist_t *fss)
|
|||
* Note: if there are multiple snaps with the
|
||||
* same GUID, we ignore all but one.
|
||||
*/
|
||||
if (avl_find(fsavl, fn, NULL) == NULL)
|
||||
avl_add(fsavl, fn);
|
||||
avl_index_t where = 0;
|
||||
if (avl_find(fsavl, fn, &where) == NULL)
|
||||
avl_insert(fsavl, fn, where);
|
||||
else
|
||||
free(fn);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue