diff --git a/sstables/sstables.cc b/sstables/sstables.cc index 0d79949b2c..e899a26589 100644 --- a/sstables/sstables.cc +++ b/sstables/sstables.cc @@ -203,10 +203,10 @@ std::unordered_map -static typename Map::key_type reverse_map(const typename Map::mapped_type& value, Map& map) { - for (auto& pair: map) { - if (pair.second == value) { - return pair.first; +static typename Map::key_type reverse_map(const typename Map::mapped_type& v, const Map& map) { + for (auto& [key, value]: map) { + if (value == v) { + return key; } } throw std::out_of_range("unable to reverse map");