FastLED 3.10.9
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 127 of file unordered_map.h.

127 {
128 if (this != &other) {
129 // Clear current content
130 clear();
131
132 // Resize if necessary
133 if (_buckets.size() != other._buckets.size()) {
134 _buckets.clear();
135 _buckets.assign(other._buckets.size(), Entry{});
136 _occupied.reset();
137 _occupied.resize(other._buckets.size());
138 _deleted.reset();
139 _deleted.resize(other._buckets.size());
140 }
141
142 // Copy all occupied entries
143 for (fl::size i = 0; i < other._buckets.size(); ++i) {
144 if (other.is_occupied(i)) {
147 ++_size;
148 }
149 }
150
152 _hash = other._hash;
154 }
155 return *this;
156 }
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