Skip to content

Commit

Permalink
tag/ApeTag: don't take reference of IterableSplitString() elements
Browse files Browse the repository at this point in the history
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<char>') does not return a reference [-Werror,-Wrange-loop-analysis]
  • Loading branch information
MaxKellermann committed Feb 4, 2020
1 parent 3fc859c commit 7c62887
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tag/ApeTag.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7c62887

Please sign in to comment.