MCPcopy Create free account
hub / github.com/FastLED/FastLED / lower_bound

Method lower_bound

src/fl/stl/flat_map.h:166–182  ·  view source on GitHub ↗

Bounds - binary search using pointer arithmetic

Source from the content-addressed store, hash-verified

164
165 // Bounds - binary search using pointer arithmetic
166 iterator lower_bound(const Key& key) FL_NOEXCEPT {
167 // Binary search: find first element where !(element < key)
168 iterator first = mData.begin();
169 size_type count = mData.size();
170
171 while (count > 0) {
172 size_type step = count / 2;
173 iterator it = first + step;
174 if (mLess(it->first, key)) {
175 first = it + 1;
176 count -= step + 1;
177 } else {
178 count = step;
179 }
180 }
181 return first;
182 }
183
184 const_iterator lower_bound(const Key& key) const FL_NOEXCEPT {
185 // Binary search: find first element where !(element < key)

Callers

nothing calls this directly

Calls 2

beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected