summaryrefslogtreecommitdiff
path: root/include/fud_hash_map.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/fud_hash_map.hpp')
-rw-r--r--include/fud_hash_map.hpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/fud_hash_map.hpp b/include/fud_hash_map.hpp
index 9220876..ba9e0c2 100644
--- a/include/fud_hash_map.hpp
+++ b/include/fud_hash_map.hpp
@@ -200,7 +200,7 @@ class HashMap {
if (hashIndexOption.isNone()) {
return insert(key, value);
}
- auto hashIndex{hashIndexOption.take()};
+ auto hashIndex{hashIndexOption.value()};
m_data[hashIndex].value() = value;
return FudStatus::Success;
}
@@ -211,7 +211,7 @@ class HashMap {
if (hashIndexOption.isNone()) {
return insert(key, std::move(value));
}
- auto hashIndex{hashIndexOption.take()};
+ auto hashIndex{hashIndexOption.value()};
m_data[hashIndex].value() = std::move(value);
return FudStatus::Success;
}
@@ -222,7 +222,7 @@ class HashMap {
if (hashIndexOption.isNone()) {
return insert(std::move(key), value);
}
- auto hashIndex{hashIndexOption.take()};
+ auto hashIndex{hashIndexOption.value()};
m_data[hashIndex].value() = value;
return FudStatus::Success;
}
@@ -233,7 +233,7 @@ class HashMap {
if (hashIndexOption.isNone()) {
return insert(std::move(key), std::move(value));
}
- auto hashIndex{hashIndexOption.take()};
+ auto hashIndex{hashIndexOption.value()};
m_data[hashIndex].value() = std::move(value);
return FudStatus::Success;
}
@@ -290,7 +290,7 @@ class HashMap {
return value;
}
- KeyValuePair extractPair(const Key& key)
+ Option<KeyValuePair> extractPair(const Key& key)
{
auto hashIndexOption = lookup(key);
if (hashIndexOption.isNone()) {
@@ -298,13 +298,13 @@ class HashMap {
}
auto hashIndex{hashIndexOption.value()};
- KeyValuePair kvPair{key, m_data[hashIndex].takeValue()};
+ KeyValuePair kvPair{std::move(m_data[hashIndex].takeKey()), std::move(m_data[hashIndex].takeValue())};
m_data[hashIndex].tombstone();
return kvPair;
}
- KeyValuePair extractPair(Key&& key)
+ Option<KeyValuePair> extractPair(Key&& key)
{
auto hashIndexOption = lookup(key);
if (hashIndexOption.isNone()) {
@@ -312,7 +312,7 @@ class HashMap {
}
auto hashIndex{hashIndexOption.value()};
- KeyValuePair kvPair{std::move(key), m_data[hashIndex].takeValue()};
+ KeyValuePair kvPair{std::move(key), std::move(m_data[hashIndex].takeValue())};
m_data[hashIndex].tombstone();
return kvPair;