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

Method prev

src/fl/stl/flat_map.h:482–495  ·  view source on GitHub ↗

Navigate to previous element by key (FastLED compatibility)

Source from the content-addressed store, hash-verified

480
481 // Navigate to previous element by key (FastLED compatibility)
482 bool prev(const Key& key, Key* prev_key, bool allow_rollover = false) const FL_NOEXCEPT {
483 auto it = find(key);
484 if (it != end()) {
485 if (it != begin()) {
486 --it;
487 *prev_key = it->first;
488 return true;
489 } else if (allow_rollover && !empty()) {
490 *prev_key = mData.back().first;
491 return true;
492 }
493 }
494 return false;
495 }
496
497 // Allows pre-allocating space
498 void reserve(size_type n) FL_NOEXCEPT {

Callers 1

FL_TEST_FILEFunction · 0.45

Calls 5

findFunction · 0.70
endFunction · 0.70
beginFunction · 0.70
emptyFunction · 0.70
backMethod · 0.45

Tested by

no test coverage detected