aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag/Tag.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/tag/Tag.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/tag/Tag.cxx')
-rw-r--r--src/tag/Tag.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tag/Tag.cxx b/src/tag/Tag.cxx
index 448f3b26a..1b338ae8d 100644
--- a/src/tag/Tag.cxx
+++ b/src/tag/Tag.cxx
@@ -118,9 +118,9 @@ Tag::GetValue(TagType type) const
{
assert(type < TAG_NUM_OF_ITEM_TYPES);
- for (unsigned i = 0; i < num_items; i++)
- if (items[i]->type == type)
- return items[i]->value;
+ for (const auto &item : *this)
+ if (item.type == type)
+ return item.value;
return nullptr;
}