From 41a7203c28d2cc7550f1bb05f767950d388326cd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 12 Jul 2014 17:22:39 +0200 Subject: Tag: add class const_iterator and methods begin(), end() Enables using range-based "for". --- src/TagSave.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/TagSave.cxx') 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); } -- cgit v1.2.3