aboutsummaryrefslogtreecommitdiffstats
path: root/src/TagSave.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-07-12 17:22:39 +0200
committerMax Kellermann <max@duempel.org>2014-07-12 17:22:39 +0200
commit41a7203c28d2cc7550f1bb05f767950d388326cd (patch)
tree0b0970bbaf06b66ec0c0b3a50d90b3f6ef65dd20 /src/TagSave.cxx
parent543a58bb874be8a510d54e91a37797b0c71b1160 (diff)
downloadmpd-41a7203c28d2cc7550f1bb05f767950d388326cd.tar.gz
mpd-41a7203c28d2cc7550f1bb05f767950d388326cd.tar.xz
mpd-41a7203c28d2cc7550f1bb05f767950d388326cd.zip
Tag: add class const_iterator and methods begin(), end()
Enables using range-based "for".
Diffstat (limited to 'src/TagSave.cxx')
-rw-r--r--src/TagSave.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/TagSave.cxx b/src/TagSave.cxx
index 3a291e115..7666287af 100644
--- a/src/TagSave.cxx
+++ b/src/TagSave.cxx
@@ -32,8 +32,7 @@ tag_save(FILE *file, const Tag &tag)
if (tag.has_playlist)
fprintf(file, "Playlist: yes\n");
- for (unsigned i = 0; i < tag.num_items; i++)
+ for (const auto &i : tag)
fprintf(file, "%s: %s\n",
- tag_item_names[tag.items[i]->type],
- tag.items[i]->value);
+ tag_item_names[i.type], i.value);
}