For the case when RB_REMOVE requires a nontrivial search to find the node to replace the one being removed, restructure to remove the replacement node, and correct the parent pointers around it first, and let the all-cases code at the end deal with the parent of deleted node, making it point to the replacement node. This removes one or two conditional branches.
Details
Details
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/sys/tree.h | ||
---|---|---|
597 ↗ | (On Diff #71808) | Perhaps use a local variable for RB_PARENT(old, field)? |
Comment Actions
I completed a full stress2 test of D24845.71955.diff. No problems seen except for this known iflib problem: https://people.freebsd.org/~pho/stress/log/dougm070.txt