Tag: add class const_iterator and methods begin(), end()

Enables using range-based "for".
This commit is contained in:
Max Kellermann
2014-07-12 17:22:39 +02:00
parent 543a58bb87
commit 41a7203c28
13 changed files with 89 additions and 47 deletions

View File

@@ -272,8 +272,7 @@ vorbis_encoder_pre_tag(Encoder *_encoder, gcc_unused Error &error)
static void
copy_tag_to_vorbis_comment(vorbis_comment *vc, const Tag *tag)
{
for (unsigned i = 0; i < tag->num_items; i++) {
const TagItem &item = *tag->items[i];
for (const auto &item : *tag) {
char *name = g_ascii_strup(tag_item_names[item.type], -1);
vorbis_comment_add_tag(vc, name, item.value);
g_free(name);