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

◆ insert()

template<typename Key, typename Value, size_t N>
Pair< bool, iterator > fl::FixedMap< Key, Value, N >::insert ( const Key & key,
const Value & value,
InsertResult * result = nullptr )
inline

Definition at line 125 of file map.h.

126 {
127 iterator it = find(key);
128 if (it != end()) {
129 if (result) {
131 }
132 // return false;
133 return {false, it};
134 }
135 if (data.size() < N) {
136 data.push_back(PairKV(key, value));
137 if (result) {
139 }
140 // return true;
141 return {true, data.end() - 1};
142 }
143 if (result) {
145 }
146 // return false;
147 return {false, end()};
148 }
VectorType::iterator iterator
Definition map.h:29
iterator end()
Definition map.h:36
VectorType data
Definition map.h:228
iterator find(const Key &key)
Definition map.h:40
fl::Pair< Key, Value > PairKV
Definition map.h:26

Referenced by fl::ScreenMap::ParseJson(), and fl::FixedMap< int, FxPtr, FASTLED_FX_ENGINE_MAX_FX >::update().

+ Here is the caller graph for this function: