diff options
Diffstat (limited to 'src/DatabaseHelpers.cxx')
-rw-r--r-- | src/DatabaseHelpers.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/DatabaseHelpers.cxx b/src/DatabaseHelpers.cxx index 4202b1247..58e7aaa3b 100644 --- a/src/DatabaseHelpers.cxx +++ b/src/DatabaseHelpers.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2013 The Music Player Daemon Project + * Copyright (C) 2003-2014 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -19,7 +19,7 @@ #include "DatabaseHelpers.hxx" #include "DatabasePlugin.hxx" -#include "Song.hxx" +#include "LightSong.hxx" #include "tag/Tag.hxx" #include <functional> @@ -37,11 +37,9 @@ struct StringLess { typedef std::set<const char *, StringLess> StringSet; static bool -CollectTags(StringSet &set, TagType tag_type, Song &song) +CollectTags(StringSet &set, TagType tag_type, const LightSong &song) { - Tag *tag = song.tag; - if (tag == nullptr) - return true; + const Tag *tag = song.tag; bool found = false; for (unsigned i = 0; i < tag->num_items; ++i) { @@ -104,12 +102,11 @@ StatsVisitTag(DatabaseStats &stats, StringSet &artists, StringSet &albums, static bool StatsVisitSong(DatabaseStats &stats, StringSet &artists, StringSet &albums, - Song &song) + const LightSong &song) { ++stats.song_count; - if (song.tag != nullptr) - StatsVisitTag(stats, artists, albums, *song.tag); + StatsVisitTag(stats, artists, albums, *song.tag); return true; } |