]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
rb_tree: optimize rb_insert
authorDoug Moore <dougm@FreeBSD.org>
Thu, 25 Aug 2022 07:26:04 +0000 (02:26 -0500)
committerDoug Moore <dougm@FreeBSD.org>
Thu, 25 Aug 2022 07:26:04 +0000 (02:26 -0500)
commitb6ce129d24ffe393c43378b1c922d1e56ea2be67
tree1913b02d8741a580e44fa5ce518ca8d732ba3e81
parent9ea2716b7758b72725b932f1ad9f3457a69cbea6
rb_tree: optimize rb_insert

In searching for where to insert a new node, RB_INSERT discards the
address of the pointer that will have to be modified, so that it must
find it again from the values of 'parent' and 'comp'. Stop discarding
that address, and so avoid having to recompute it.

Reviewed by: alc
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D36317
sys/sys/tree.h