| 116 | |
| 117 | |
| 118 | void BitArray::clear() |
| 119 | { |
| 120 | uint16_t b = _bytes; |
| 121 | for (uint8_t s = 0; s < _segments; s++) |
| 122 | { |
| 123 | uint8_t *p = _ar[s]; |
| 124 | if (p) |
| 125 | { |
| 126 | uint8_t t = min(b, (uint16_t) BA_SEGMENT_SIZE); |
| 127 | b -= t; |
| 128 | while(t--) |
| 129 | { |
| 130 | *p++ = 0; |
| 131 | } |
| 132 | } |
| 133 | if (b == 0) break; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | |
| 138 |