Narrow the scope of iterators

Also make sure that it is visible at first glance that iterators are
not taken from temporaries.
This commit is contained in:
Urs Fleisch
2023-07-16 06:41:53 +02:00
parent c2c9e8989c
commit 77ab5e9689
17 changed files with 44 additions and 80 deletions

View File

@ -65,8 +65,8 @@ int main(int argc, char *argv[])
<< " bytes in tag"
<< endl;
auto it = id3v2tag->frameList().begin();
for(; it != id3v2tag->frameList().end(); it++) {
const auto &frames = id3v2tag->frameList();
for(auto it = frames.begin(); it != frames.end(); it++) {
cout << (*it)->frameID();
if(auto comment = dynamic_cast<ID3v2::CommentsFrame *>(*it))
@ -100,8 +100,8 @@ int main(int argc, char *argv[])
cout << endl << "APE" << endl;
if(ape) {
for(auto it = ape->itemListMap().begin();
it != ape->itemListMap().end(); ++it)
const auto &items = ape->itemListMap();
for(auto it = items.begin(); it != items.end(); ++it)
{
if((*it).second.type() != APE::Item::Binary)
cout << (*it).first << " - \"" << (*it).second.toString() << "\"" << endl;