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/db/DatabasePrint.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/db/DatabasePrint.cxx') diff --git a/src/db/DatabasePrint.cxx b/src/db/DatabasePrint.cxx index f6663311e..498aedf97 100644 --- a/src/db/DatabasePrint.cxx +++ b/src/db/DatabasePrint.cxx @@ -184,12 +184,10 @@ PrintUniqueTag(Client &client, TagType tag_type, assert(value != nullptr); client_printf(client, "%s: %s\n", tag_item_names[tag_type], value); - for (unsigned i = 0, n = tag.num_items; i < n; i++) { - const TagItem &item = *tag.items[i]; + for (const auto &item : tag) if (item.type != tag_type) client_printf(client, "%s: %s\n", tag_item_names[item.type], item.value); - } return true; } -- cgit v1.2.3