From 7c62887df706b4e6c9d43c32ee083fa0b2c8d250 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 4 Feb 2020 16:53:45 +0100 Subject: [PATCH] tag/ApeTag: don't take reference of IterableSplitString() elements This doesn't work because IterableSplitString() returns its elements by value. Fixes clang warning: loop variable 'i' is always a copy because the range of type 'IterableSplitString' (aka 'BasicIterableSplitString') does not return a reference [-Werror,-Wrange-loop-analysis] --- src/tag/ApeTag.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tag/ApeTag.cxx b/src/tag/ApeTag.cxx index aec22cdee..ea417c103 100644 --- a/src/tag/ApeTag.cxx +++ b/src/tag/ApeTag.cxx @@ -54,14 +54,14 @@ tag_ape_import_item(unsigned long flags, return false; if (handler.WantPair()) - for (const auto &i : IterableSplitString(value, '\0')) + for (const auto i : IterableSplitString(value, '\0')) handler.OnPair(key, i); TagType type = tag_ape_name_parse(key); if (type == TAG_NUM_OF_ITEM_TYPES) return false; - for (const auto &i : IterableSplitString(value, '\0')) + for (const auto i : IterableSplitString(value, '\0')) handler.OnTag(type, i); return true;