aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranciszek Malinka <franciszek.malinka@gmail.com>2022-11-02 18:33:13 +0100
committerFranciszek Malinka <franciszek.malinka@gmail.com>2022-11-02 19:23:49 +0100
commit7d1fb7f1743fac00b221e0f484320966a6f77e78 (patch)
tree430c1ac5e78b04a9778fc5adf091c08f7c9b86d0
parent1169c54fd0ecfe151c953a9f1eab8bf4e001e62d (diff)
Fixescatalog
-rw-r--r--komfydb/storage/catalog.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/komfydb/storage/catalog.cc b/komfydb/storage/catalog.cc
index 5c3baee..0a5c2b1 100644
--- a/komfydb/storage/catalog.cc
+++ b/komfydb/storage/catalog.cc
@@ -9,12 +9,11 @@ namespace {
template <typename K, typename V>
absl::StatusOr<V> StatusOrMapElement(const absl::flat_hash_map<K, V>& map,
- const K& value) {
- auto it = map.find(value);
- if (it == map.end()) {
- return absl::InvalidArgumentError("No table with given name");
+ const K& key) {
+ if (!map.contains(key)) {
+ return absl::InvalidArgumentError("No element for given key.");
}
- return it->second;
+ return map.at(key);
}
}; // namespace