FastLED 3.10.8
Loading...
Searching...
No Matches

◆ operator=() [1/3]

template<typename Key, typename T, typename Hash = Hash<Key>, typename KeyEqual = EqualTo<Key>, int INLINED_COUNT = FASTLED_HASHMAP_INLINED_COUNT>
unordered_map & fl::unordered_map< Key, T, Hash, KeyEqual, INLINED_COUNT >::operator= ( const unordered_map< Key, T, Hash, KeyEqual, INLINED_COUNT > & other)
inline

Definition at line 125 of file unordered_map.h.

125 {
126 if (this != &other) {
127 // Clear current content
128 clear();
129
130 // Resize if necessary
131 if (_buckets.size() != other._buckets.size()) {
132 _buckets.clear();
133 _buckets.assign(other._buckets.size(), Entry{});
134 _occupied.reset();
135 _occupied.resize(other._buckets.size());
136 _deleted.reset();
137 _deleted.resize(other._buckets.size());
138 }
139
140 // Copy all occupied entries
141 for (fl::size i = 0; i < other._buckets.size(); ++i) {
142 if (other.is_occupied(i)) {
145 ++_size;
146 }
147 }
148
150 _hash = other._hash;
152 }
153 return *this;
154 }
fl::bitset< 1024 > _occupied
bool is_occupied(fl::size idx) const FL_NO_EXCEPT
void clear() FL_NO_EXCEPT
fl::vector_inlined< Entry, INLINED_COUNT > _buckets
void mark_occupied(fl::size idx) FL_NO_EXCEPT
fl::bitset< 1024 > _deleted