MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / clear

Method clear

libraries/BitArray/BitArray.cpp:118–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116
117
118void 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

Callers 1

unittestFunction · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36