From 3965b490a953398eb8e66adbe78fdd2a8fdd09d7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 24 Apr 2014 10:31:19 +0200 Subject: db/Helpers: use reference instead of pointer --- src/db/Helpers.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/db') diff --git a/src/db/Helpers.cxx b/src/db/Helpers.cxx index 5eb50b4e5..c6c7e3642 100644 --- a/src/db/Helpers.cxx +++ b/src/db/Helpers.cxx @@ -26,6 +26,7 @@ #include #include +#include #include struct StringLess { @@ -40,12 +41,13 @@ typedef std::set StringSet; static bool CollectTags(StringSet &set, TagType tag_type, const LightSong &song) { - const Tag *tag = song.tag; + assert(song.tag != nullptr); + const Tag &tag = *song.tag; bool found = false; - for (unsigned i = 0; i < tag->num_items; ++i) { - if (tag->items[i]->type == tag_type) { - set.insert(tag->items[i]->value); + for (unsigned i = 0; i < tag.num_items; ++i) { + if (tag.items[i]->type == tag_type) { + set.insert(tag.items[i]->value); found = true; } } -- cgit v1.2.3