| 126 | } |
| 127 | |
| 128 | bool clear(T value) |
| 129 | { |
| 130 | if (singular) |
| 131 | { |
| 132 | fb_assert(tree.isEmpty()); |
| 133 | |
| 134 | if (value == singular_value) |
| 135 | { |
| 136 | singular = false; |
| 137 | return true; |
| 138 | } |
| 139 | return false; |
| 140 | } |
| 141 | |
| 142 | const T val_aligned = value & ~(T)(BUNCH_BITS - 1); |
| 143 | if (tree.isPositioned(val_aligned) || tree.locate(val_aligned)) |
| 144 | { |
| 145 | const BUNCH_T bit_mask = BUNCH_ONE << (value - val_aligned); |
| 146 | Bucket *current_bucket = &tree.current(); |
| 147 | if (current_bucket->bits & bit_mask) |
| 148 | { |
| 149 | current_bucket->bits &= ~bit_mask; |
| 150 | if (!current_bucket->bits) |
| 151 | tree.fastRemove(); |
| 152 | return true; |
| 153 | } |
| 154 | } |
| 155 | return false; |
| 156 | } |
| 157 | |
| 158 | bool test(T value) |
| 159 | { |
no test coverage detected