Clarify the new Red-Black post-order traversal code a bit.
Heikki Linnakangas <heikki.linnakangas@iki.fi>
Clarify the new Red-Black post-order traversal code a bit. Coverity complained about the for(;;) loop, because it never actually iterated. It was used just to be able to use "break" to exit it early. I agree with Coverity, that's a bit confusing, so refactor the code to use if-else instead. While we're at it, use a local variable to hold the "current" node. That's shorter and clearer than referring to "iter->last_visited" all the time.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/lib/rbtree.c | modified | +24 −22 |