FastLED
3.9.15
Loading...
Searching...
No Matches
◆
rehash()
template<typename
Key
, typename T, typename
Hash
= Hash<Key>, typename KeyEqual = EqualTo<Key>, int INLINED_COUNT = FASTLED_HASHMAP_INLINED_COUNT>
void
fl::HashMap
<
Key
, T,
Hash
, KeyEqual, INLINED_COUNT >::rehash
(
fl::size
new_cap
)
inline
private
Definition at line
587
of file
hash_map.h
.
587
{
588
new_cap
=
next_power_of_two
(
new_cap
);
589
fl::vector_inlined<Entry, INLINED_COUNT>
old
;
590
fl::bitset<1024>
old_occupied
=
_occupied
;
591
592
_buckets
.swap(
old
);
593
_buckets
.clear();
594
_buckets
.assign(
new_cap
,
Entry
{});
595
596
_occupied
.reset();
597
_occupied
.resize(
new_cap
);
598
_deleted
.reset();
599
_deleted
.resize(
new_cap
);
600
601
_size
=
_tombstones
= 0;
602
603
for
(
fl::size
i
= 0;
i
<
old
.
size
();
i
++) {
604
if
(
old_occupied
.test(
i
))
605
insert
(
fl::move
(
old
[
i
].
key
),
fl::move
(
old
[
i
].
value
));
606
}
607
}
fl::HashMap::_size
fl::size _size
Definition
hash_map.h:702
fl::HashMap::next_power_of_two
static fl::size next_power_of_two(fl::size n)
Definition
hash_map.h:445
fl::HashMap::size
fl::size size() const
Definition
hash_map.h:401
fl::HashMap::_deleted
fl::bitset< 1024 > _deleted
Definition
hash_map.h:706
fl::HashMap::_occupied
fl::bitset< 1024 > _occupied
Definition
hash_map.h:705
fl::HashMap::_tombstones
fl::size _tombstones
Definition
hash_map.h:703
fl::HashMap::_buckets
FL_DISABLE_WARNING_POP fl::vector_inlined< Entry, INLINED_COUNT > _buckets
Definition
hash_map.h:701
fl::HashMap::insert
void insert(const Key &key, const T &value)
Definition
hash_map.h:234
fl::HashMap
Definition
hash_map.h:60
fl::HashMap::Entry
Definition
hash_map.h:436
fl
HashMap
Generated on Fri Aug 22 2025 20:59:36 for FastLED by
1.13.2