summaryrefslogtreecommitdiff
path: root/src/TagPrint.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/TagPrint.cxx
parent543a58bb874be8a510d54e91a37797b0c71b1160 (diff)
Tag: add class const_iterator and methods begin(), end()
Enables using range-based "for".
Diffstat (limited to 'src/TagPrint.cxx')
-rw-r--r--src/TagPrint.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/TagPrint.cxx b/src/TagPrint.cxx
index 228b5fd90..297bf45e3 100644
--- a/src/TagPrint.cxx
+++ b/src/TagPrint.cxx
@@ -47,9 +47,7 @@ void tag_print(Client &client, const Tag &tag)
if (tag.time >= 0)
client_printf(client, SONG_TIME "%i\n", tag.time);
- for (unsigned i = 0; i < tag.num_items; i++) {
+ for (const auto &i : tag)
client_printf(client, "%s: %s\n",
- tag_item_names[tag.items[i]->type],
- tag.items[i]->value);
- }
+ tag_item_names[i.type], i.value);
}