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 141 of file map.h.

141 {
142 iterator it = find(key);
143 if (it != end()) {
144 if (result) {
146 }
147 // return false;
148 return {false, it};
149 }
150 if (data.size() < N) {
151 data.push_back(PairKV(key, value));
152 if (result) {
154 }
155 // return true;
156 return {true, data.end() - 1};
157 }
158 if (result) {
160 }
161 //return false;
162 return {false, end()};
163 }
VectorType::iterator iterator
Definition map.h:34
iterator end()
Definition map.h:44
VectorType data
Definition map.h:252
iterator find(const Key &key)
Definition map.h:54
fl::Pair< Key, Value > PairKV
Definition map.h:31

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

+ Here is the caller graph for this function: