parse/enum: use references for range binding iteration to avoid copies

This commit is contained in:
Danny Robson 2022-07-25 11:57:53 +10:00
parent 013fd2bb61
commit 681474c83d

View File

@ -143,7 +143,7 @@ namespace cruft::parse::enumeration {
static_assert (std::is_integral_v<ValueT>);
if constexpr (std::is_same_v<ValueT, underlying_type>) {
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