From 681474c83dfb182a5145ef55b29786aa451fbe47 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 25 Jul 2022 11:57:53 +1000 Subject: [PATCH] parse/enum: use references for range binding iteration to avoid copies --- parse/enum.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse/enum.hpp b/parse/enum.hpp index 22e5a097..d40052e0 100644 --- a/parse/enum.hpp +++ b/parse/enum.hpp @@ -143,7 +143,7 @@ namespace cruft::parse::enumeration { static_assert (std::is_integral_v); if constexpr (std::is_same_v) { - for (auto const [key,val]: m_cache) { + for (auto const &[key,val]: m_cache) { if (equal (key, str)) { str = str.consume (key.size ()); // We must cast the value here so that enum