Page MenuHomeFreeBSD

rb tree: change INSERT_COLOR to avoid always-true test
Needs ReviewPublic

Authored by dougm on Sun, Oct 12, 8:01 AM.
Tags
None
Referenced Files
F131948879: D53047.id164033.diff
Sun, Oct 12, 10:40 AM
F131947434: D53047.diff
Sun, Oct 12, 10:23 AM
F131947172: D53047.id.diff
Sun, Oct 12, 10:20 AM
Subscribers
None

Details

Reviewers
rlibby
kib
markj
Summary

Separate the first iteration of the loop in RB_INSERT_COLOR from the rest. That iteration always reaches the 'continue' statement, and gcc compilers, not knowing that, issue warnings about the use of an uninitialized 'child' variable. By separating the first iteration, the always-true test is not made, saving one instruction, but at the cost of code size growing slightly.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

dougm requested review of this revision.Sun, Oct 12, 8:01 AM
dougm created this revision.