aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag/Set.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/tag/Set.cxx')
-rw-r--r--src/tag/Set.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/tag/Set.cxx b/src/tag/Set.cxx
index 59f66bf84..47a8423bf 100644
--- a/src/tag/Set.cxx
+++ b/src/tag/Set.cxx
@@ -30,10 +30,10 @@ CopyTagItem(TagBuilder &dest, TagType dest_type,
const Tag &src, TagType src_type)
{
bool found = false;
- const unsigned n = src.num_items;
- for (unsigned i = 0; i < n; ++i) {
- if (src.items[i]->type == src_type) {
- dest.AddItem(dest_type, src.items[i]->value);
+
+ for (const auto &item : src) {
+ if (item.type == src_type) {
+ dest.AddItem(dest_type, item.value);
found = true;
}
}
@@ -87,11 +87,10 @@ TagSet::CheckUnique(TagType dest_type,
uint32_t group_mask)
{
bool found = false;
- for (unsigned i = 0; i < tag.num_items; ++i) {
- if (tag.items[i]->type == src_type) {
- InsertUnique(tag, dest_type,
- tag.items[i]->value,
- group_mask);
+
+ for (const auto &item : tag) {
+ if (item.type == src_type) {
+ InsertUnique(tag, dest_type, item.value, group_mask);
found = true;
}
}