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

◆ update() [1/2]

template<typename Key, typename Value, fl::size N>
bool fl::FixedMap< Key, Value, N >::update ( const Key & key,
const Value & value,
bool insert_if_missing = true )
inline

Definition at line 173 of file map.h.

174 {
175 iterator it = find(key);
176 if (it != end()) {
177 it->second = value;
178 return true;
179 } else if (insert_if_missing) {
180 return insert(key, value).first;
181 }
182 return false;
183 }
VectorType::iterator iterator
Definition map.h:29
iterator end()
Definition map.h:36
pair< bool, iterator > insert(const Key &key, const Value &value, InsertResult *result=nullptr)
Definition map.h:125
iterator find(const Key &key)
Definition map.h:40