aboutsummaryrefslogtreecommitdiff
path: root/contrib/bc/manuals/dc/HN.1
diff options
context:
space:
mode:
authorDoug Moore <dougm@FreeBSD.org>2022-06-10 21:53:16 +0000
committerDoug Moore <dougm@FreeBSD.org>2022-06-10 21:53:16 +0000
commit36447829aee545ad9eafbfff3a783ee58cfb28fd (patch)
treed646adec2260043c4e18f60d61827e0bc1248fb3 /contrib/bc/manuals/dc/HN.1
parent19bb5a7244ff0374f44068a20df9393a1c88de5d (diff)
downloadsrc-36447829aee545ad9eafbfff3a783ee58cfb28fd.tar.gz
src-36447829aee545ad9eafbfff3a783ee58cfb28fd.zip
rb_tree: drop needless tests from rb_next, rb_prev
In RB_NEXT, when there is no RB_RIGHT node, the search must proceed through the parent node. There is code written to handle the case when the parent is non-NULL and the current element is the left child of that parent. If you assume that the current element is either the left child of its parent, or the right child of its parent, but not both, then this test is not necessary. Instead of assigning RB_PARENT(elm, field) to elm when elm == RB_LEFT, removing the test has the code assign RB_PARENT(elm, field) to elm when elm != RB_RIGHT. There's no need to examine the RB_LEFT field at all. This change removes that needless RB_LEFT test, and makes a similar change to the RB_PREV implementation. Reviewed by: alc MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D35450
Diffstat (limited to 'contrib/bc/manuals/dc/HN.1')
0 files changed, 0 insertions, 0 deletions