diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index a1557519e..b676c1f58 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -1780,7 +1780,7 @@ class test_lru_t : public lru_cache_t { std::vector values() const { std::vector result; - for (const auto &p : *this) { + for (auto p : *this) { result.push_back(p); } return result; @@ -1788,7 +1788,7 @@ class test_lru_t : public lru_cache_t { std::vector ints() const { std::vector result; - for (const auto &p : *this) { + for (auto p : *this) { result.push_back(p.second); } return result; diff --git a/src/lru.h b/src/lru.h index 1ed1412bb..4d930be87 100644 --- a/src/lru.h +++ b/src/lru.h @@ -318,7 +318,7 @@ class lru_cache_t { // Count iterators size_t iter_dist = 0; - for (const auto &p : *this) { + for (auto p : *this) { UNUSED(p); iter_dist++; }