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 ( size_t new_cap)
inlineprivate

Definition at line 468 of file hash_map.h.

468 {
472
473 _buckets.swap(old);
474 _buckets.clear();
475 _buckets.assign(new_cap, Entry{});
476
477 _occupied.reset();
478 _occupied.resize(new_cap);
479 _deleted.reset();
480 _deleted.resize(new_cap);
481
482 _size = _tombstones = 0;
483
484 for (size_t i = 0; i < old.size(); i++) {
485 if (old_occupied.test(i))
486 insert(old[i].key, old[i].value);
487 }
488 }
size_t _size
Definition hash_map.h:577
static size_t next_power_of_two(size_t n)
Definition hash_map.h:326
size_t _tombstones
Definition hash_map.h:578
fl::bitset< 1024 > _deleted
Definition hash_map.h:581
size_t size() const
Definition hash_map.h:286
fl::bitset< 1024 > _occupied
Definition hash_map.h:580
fl::vector_inlined< Entry, INLINED_COUNT > _buckets
Definition hash_map.h:576
void insert(const Key &key, const T &value)
Definition hash_map.h:200
Definition hash_map.h:317

Referenced by fl::HashMap< Key, T, Hash, KeyEqual >::insert().

+ Here is the caller graph for this function: