MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / clear

Method clear

src/common/classes/sparse_bitmap.h:128–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

resetMethod · 0.45

Calls 5

isEmptyMethod · 0.45
isPositionedMethod · 0.45
locateMethod · 0.45
currentMethod · 0.45
fastRemoveMethod · 0.45

Tested by

no test coverage detected