| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrRedBlackTree_DEFINED | 8 #ifndef GrRedBlackTree_DEFINED |
| 9 #define GrRedBlackTree_DEFINED | 9 #define GrRedBlackTree_DEFINED |
| 10 | 10 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 int countOf(const T& t) const; | 118 int countOf(const T& t) const; |
| 119 | 119 |
| 120 /** | 120 /** |
| 121 * Removes the item indicated by an iterator. The iterator will not be valid | 121 * Removes the item indicated by an iterator. The iterator will not be valid |
| 122 * afterwards. | 122 * afterwards. |
| 123 * | 123 * |
| 124 * @param iter iterator of item to remove. Must be valid (not end()). | 124 * @param iter iterator of item to remove. Must be valid (not end()). |
| 125 */ | 125 */ |
| 126 void remove(const Iter& iter) { deleteAtNode(iter.fN); } | 126 void remove(const Iter& iter) { deleteAtNode(iter.fN); } |
| 127 | 127 |
| 128 static void UnitTest(); | |
| 129 | |
| 130 private: | 128 private: |
| 131 enum Color { | 129 enum Color { |
| 132 kRed_Color, | 130 kRed_Color, |
| 133 kBlack_Color | 131 kBlack_Color |
| 134 }; | 132 }; |
| 135 | 133 |
| 136 enum Child { | 134 enum Child { |
| 137 kLeft_Child = 0, | 135 kLeft_Child = 0, |
| 138 kRight_Child = 1 | 136 kRight_Child = 1 |
| 139 }; | 137 }; |
| (...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 return validateChildRelationsFailed(); | 934 return validateChildRelationsFailed(); |
| 937 } | 935 } |
| 938 } | 936 } |
| 939 } | 937 } |
| 940 } | 938 } |
| 941 return true; | 939 return true; |
| 942 } | 940 } |
| 943 #endif | 941 #endif |
| 944 | 942 |
| 945 #endif | 943 #endif |
| OLD | NEW |