- Notifications
You must be signed in to change notification settings - Fork5
Commite21db14
committed
Clarify the new Red-Black post-order traversal code a bit.
Coverity complained about the for(;;) loop, because it never actuallyiterated. It was used just to be able to use "break" to exit it early. Iagree with Coverity, that's a bit confusing, so refactor the code touse if-else instead.While we're at it, use a local variable to hold the "current" node. That'sshorter and clearer than referring to "iter->last_visited" all the time.1 parent6591f42 commite21db14
1 file changed
+24
-22
lines changedLines changed: 24 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
781 | 781 |
| |
782 | 782 |
| |
783 | 783 |
| |
| 784 | + | |
| 785 | + | |
| 786 | + | |
784 | 787 |
| |
785 | 788 |
| |
786 | 789 |
| |
787 | 790 |
| |
788 | 791 |
| |
789 | 792 |
| |
790 |
| - | |
| 793 | + | |
791 | 794 |
| |
792 | 795 |
| |
793 | 796 |
| |
794 | 797 |
| |
795 |
| - | |
796 |
| - | |
| 798 | + | |
| 799 | + | |
797 | 800 |
| |
798 | 801 |
| |
799 | 802 |
| |
800 | 803 |
| |
801 | 804 |
| |
802 |
| - | |
| 805 | + | |
803 | 806 |
| |
804 |
| - | |
| 807 | + | |
805 | 808 |
| |
806 | 809 |
| |
807 | 810 |
| |
| |||
810 | 813 |
| |
811 | 814 |
| |
812 | 815 |
| |
813 |
| - | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
814 | 829 |
| |
815 |
| - | |
816 |
| - | |
817 |
| - | |
818 |
| - | |
819 |
| - | |
820 |
| - | |
821 |
| - | |
822 |
| - | |
823 |
| - | |
824 |
| - | |
825 |
| - | |
826 |
| - | |
827 |
| - | |
828 |
| - | |
829 | 830 |
| |
| 831 | + | |
830 | 832 |
| |
831 | 833 |
| |
832 | 834 |
| |
833 |
| - | |
834 | 835 |
| |
835 | 836 |
| |
836 |
| - | |
| 837 | + | |
| 838 | + | |
837 | 839 |
| |
838 | 840 |
| |
839 | 841 |
| |
|
0 commit comments
Comments
(0)