dense_map/set: minor changes

This commit is contained in:
Michele Caini
2022-03-17 14:23:29 +01:00
parent da43ef0982
commit 08d9e8d076
2 changed files with 5 additions and 5 deletions

View File

@@ -116,7 +116,7 @@ public:
}
[[nodiscard]] reference operator[](const difference_type value) const ENTT_NOEXCEPT {
return *dense_map_iterator{it + value};
return {it[value].element.first, it[value].element.second};
}
[[nodiscard]] pointer operator->() const ENTT_NOEXCEPT {
@@ -124,7 +124,7 @@ public:
}
[[nodiscard]] reference operator*() const ENTT_NOEXCEPT {
return value_type{it->element.first, it->element.second};
return {it->element.first, it->element.second};
}
template<typename ILhs, typename IRhs>
@@ -214,7 +214,7 @@ public:
}
[[nodiscard]] reference operator*() const ENTT_NOEXCEPT {
return value_type{it[offset].element.first, it[offset].element.second};
return {it[offset].element.first, it[offset].element.second};
}
[[nodiscard]] std::size_t index() const ENTT_NOEXCEPT {
@@ -581,7 +581,7 @@ public:
return std::make_pair(it, false);
}
node.next = std::exchange(sparse.first()[index], size() - 1u);
std::swap(node.next, sparse.first()[index]);
if(size() > (bucket_count() * max_load_factor())) {
rehash(bucket_count() * 2u);

View File

@@ -507,7 +507,7 @@ public:
return std::make_pair(it, false);
}
node.first = std::exchange(sparse.first()[index], size() - 1u);
std::swap(node.first, sparse.first()[index]);
if(size() > (bucket_count() * max_load_factor())) {
rehash(bucket_count() * 2u);