diff --git a/taglib/ape/apetag.cpp b/taglib/ape/apetag.cpp index 7fb4a21c..bd7c62ab 100644 --- a/taglib/ape/apetag.cpp +++ b/taglib/ape/apetag.cpp @@ -323,11 +323,11 @@ bool APE::Tag::setComplexProperties(const String &key, const List &v auto frontItems = List(); auto backItems = List(); - for(auto property : value) { - ByteVector data = property.value("description").value().data(String::UTF8) + for(const auto &property : value) { + auto data = property.value("description").value().data(String::UTF8) .append('\0') .append(property.value("data").value()); - String pictureType = property.value("pictureType").value(); + auto pictureType = property.value("pictureType").value(); Item item; item.setType(Item::Binary); item.setBinaryData(data); diff --git a/taglib/asf/asftag.cpp b/taglib/asf/asftag.cpp index adce2a2e..93fac8b6 100644 --- a/taglib/asf/asftag.cpp +++ b/taglib/asf/asftag.cpp @@ -432,7 +432,7 @@ bool ASF::Tag::setComplexProperties(const String &key, const List &v if(uppercaseKey == "PICTURE") { removeItem("WM/Picture"); - for(auto property : value) { + for(const auto &property : value) { ASF::Picture picture; picture.setPicture(property.value("data").value()); picture.setMimeType(property.value("mimeType").value()); diff --git a/taglib/flac/flacfile.cpp b/taglib/flac/flacfile.cpp index 40ed77d3..5387257d 100644 --- a/taglib/flac/flacfile.cpp +++ b/taglib/flac/flacfile.cpp @@ -200,8 +200,8 @@ bool FLAC::File::setComplexProperties(const String &key, const List if(uppercaseKey == "PICTURE") { removePictures(); - for(auto property : value) { - FLAC::Picture *picture = new FLAC::Picture; + for(const auto &property : value) { + auto picture = new FLAC::Picture; picture->setData(property.value("data").value()); picture->setMimeType(property.value("mimeType").value()); picture->setDescription(property.value("description").value()); diff --git a/taglib/mp4/mp4tag.cpp b/taglib/mp4/mp4tag.cpp index 4bfe9908..85fa6527 100644 --- a/taglib/mp4/mp4tag.cpp +++ b/taglib/mp4/mp4tag.cpp @@ -558,8 +558,8 @@ bool MP4::Tag::setComplexProperties(const String &key, const List &v const String uppercaseKey = key.upper(); if(uppercaseKey == "PICTURE") { CoverArtList pictures; - for(auto property : value) { - String mimeType = property.value("mimeType").value(); + for(const auto &property : value) { + auto mimeType = property.value("mimeType").value(); CoverArt::Format format; if(mimeType == "image/bmp") { format = CoverArt::BMP; diff --git a/taglib/mpeg/id3v2/id3v2tag.cpp b/taglib/mpeg/id3v2/id3v2tag.cpp index f3d9c71b..d3d02c3d 100644 --- a/taglib/mpeg/id3v2/id3v2tag.cpp +++ b/taglib/mpeg/id3v2/id3v2tag.cpp @@ -501,7 +501,7 @@ bool ID3v2::Tag::setComplexProperties(const String &key, const List if(uppercaseKey == "PICTURE") { removeFrames("APIC"); - for(auto property : value) { + for(const auto &property : value) { auto picture = new AttachedPictureFrame; picture->setPicture(property.value("data").value()); picture->setMimeType(property.value("mimeType").value()); @@ -514,7 +514,7 @@ bool ID3v2::Tag::setComplexProperties(const String &key, const List else if(uppercaseKey == "GENERALOBJECT") { removeFrames("GEOB"); - for(auto property : value) { + for(const auto &property : value) { auto geob = new GeneralEncapsulatedObjectFrame; geob->setObject(property.value("data").value()); geob->setMimeType(property.value("mimeType").value()); diff --git a/taglib/ogg/xiphcomment.cpp b/taglib/ogg/xiphcomment.cpp index 2e0450a4..3769057d 100644 --- a/taglib/ogg/xiphcomment.cpp +++ b/taglib/ogg/xiphcomment.cpp @@ -272,8 +272,8 @@ bool Ogg::XiphComment::setComplexProperties(const String &key, const ListsetData(property.value("data").value()); picture->setMimeType(property.value("mimeType").value()); picture->setDescription(property.value("description").value());