From 2103ff82c3ccbd6f8ee3c6bad1842f39d3e1d072 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 17 May 2022 08:37:04 -0700 Subject: [NFC] Make InsertOrderedMap::insert's param const (#4669) Being a const reference allows writing insert({a, b}), which will be useful in a future PR, and there is no reason to actually update the reference. --- src/support/insert_ordered.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/support/insert_ordered.h b/src/support/insert_ordered.h index 12c98a3b2..6b0f54968 100644 --- a/src/support/insert_ordered.h +++ b/src/support/insert_ordered.h @@ -96,7 +96,7 @@ template struct InsertOrderedMap { const_iterator begin() const { return List.begin(); } const_iterator end() const { return List.end(); } - std::pair insert(std::pair& kv) { + std::pair insert(const std::pair& kv) { // Try inserting with a placeholder list iterator. auto inserted = Map.insert({kv.first, List.end()}); if (inserted.second) { -- cgit v1.2.3