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

Method upper_bound

src/fl/stl/flat_set.h:155–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153 }
154
155 iterator upper_bound(const Key& key) {
156 // Binary search: find first element where key < element
157 iterator first = mData.begin();
158 size_type count = mData.size();
159
160 while (count > 0) {
161 size_type step = count / 2;
162 iterator it = first + step;
163 if (!mLess(key, *it)) {
164 first = it + 1;
165 count -= step + 1;
166 } else {
167 count = step;
168 }
169 }
170 return first;
171 }
172
173 const_iterator upper_bound(const Key& key) const {
174 // Binary search: find first element where key < element

Callers

nothing calls this directly

Calls 2

beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected