FastLED 3.9.15
Loading...
Searching...
No Matches

◆ operator[]()

template<typename Key, typename Value, typename Less = fl::less<Key>>
Value & fl::SortedHeapMap< Key, Value, Less >::operator[] ( const Key & key)
inline

Definition at line 334 of file map.h.

334 {
335 iterator it = find(key);
336 if (it != end()) {
337 return it->second;
338 }
340 bool ok = data.insert(pair);
341 FASTLED_ASSERT(ok, "Failed to insert into SortedHeapMap");
342 return data.find(pair)->second; // TODO: optimize.
343 }
iterator end()
Definition map.h:316
SortedHeapVector< value_type, PairLess >::iterator iterator
Definition map.h:306
fl::pair< Key, Value > value_type
Definition map.h:275
SortedHeapVector< value_type, PairLess > data
Definition map.h:292
iterator find(const Key &key)
Definition map.h:416