aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/db/Helpers.cxx10
1 files changed, 6 insertions, 4 deletions
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 <functional>
#include <set>
+#include <assert.h>
#include <string.h>
struct StringLess {
@@ -40,12 +41,13 @@ typedef std::set<const char *, StringLess> 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;
}
}