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/Count.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/db/Count.cxx') diff --git a/src/db/Count.cxx b/src/db/Count.cxx index ec3eacd1f..4fd53a73b 100644 --- a/src/db/Count.cxx +++ b/src/db/Count.cxx @@ -73,9 +73,7 @@ static bool CollectGroupCounts(TagCountMap &map, TagType group, const Tag &tag) { bool found = false; - for (unsigned i = 0; i < tag.num_items; ++i) { - const TagItem &item = *tag.items[i]; - + for (const auto &item : tag) { if (item.type == group) { auto r = map.insert(std::make_pair(item.value, SearchStats())); -- cgit v1.2.3