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)
inlineprivate

Definition at line 587 of file hash_map.h.

587 {
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))
606 }
607 }
fl::size _size
Definition hash_map.h:702
static fl::size next_power_of_two(fl::size n)
Definition hash_map.h:445
fl::size size() const
Definition hash_map.h:401
fl::bitset< 1024 > _deleted
Definition hash_map.h:706
fl::bitset< 1024 > _occupied
Definition hash_map.h:705
fl::size _tombstones
Definition hash_map.h:703
FL_DISABLE_WARNING_POP fl::vector_inlined< Entry, INLINED_COUNT > _buckets
Definition hash_map.h:701
void insert(const Key &key, const T &value)
Definition hash_map.h:234
Definition hash_map.h:436