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

◆ operator[]()

template<typename Key, typename T, typename Hash = Hash<Key>, typename KeyEqual = EqualTo<Key>, int INLINED_COUNT = FASTLED_HASHMAP_INLINED_COUNT>
T & fl::HashMap< Key, T, Hash, KeyEqual, INLINED_COUNT >::operator[] ( const Key & key)
inline

Definition at line 270 of file hash_map.h.

270 {
271 size_t idx;
272 bool is_new;
273
275 idx = p.first;
276 is_new = p.second;
277 if (is_new) {
278 _buckets[idx].key = key;
279 _buckets[idx].value = T{};
281 ++_size;
282 }
283 return _buckets[idx].value;
284 }
size_t _size
Definition hash_map.h:577
void mark_occupied(size_t idx)
Definition hash_map.h:302
pair< size_t, bool > find_slot(const Key &key) const
Definition hash_map.h:333
fl::vector_inlined< Entry, INLINED_COUNT > _buckets
Definition hash_map.h:576