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
274
fl::pair<size_t, bool>
p
=
find_slot
(
key
);
275
idx
=
p
.first;
276
is_new
=
p
.second;
277
if
(
is_new
) {
278
_buckets
[
idx
].key =
key
;
279
_buckets
[
idx
].value =
T
{};
280
mark_occupied
(
idx
);
281
++
_size
;
282
}
283
return
_buckets
[
idx
].value;
284
}
fl::HashMap::_size
size_t _size
Definition
hash_map.h:577
fl::HashMap::mark_occupied
void mark_occupied(size_t idx)
Definition
hash_map.h:302
fl::HashMap::find_slot
pair< size_t, bool > find_slot(const Key &key) const
Definition
hash_map.h:333
fl::HashMap::_buckets
fl::vector_inlined< Entry, INLINED_COUNT > _buckets
Definition
hash_map.h:576
fl::HashMap
Definition
hash_map.h:49
fl
HashMap
Generated on Sat May 24 2025 22:44:25 for FastLED by
1.13.2