aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-04-24 10:31:19 +0200
committerMax Kellermann <max@duempel.org>2014-04-24 10:31:19 +0200
commit3965b490a953398eb8e66adbe78fdd2a8fdd09d7 (patch)
tree95c397388aa49bfacad98984a31b17e904302bd6
parentb999e16406ca7cdf38b1364cee48be50e2f1d756 (diff)
downloadmpd-3965b490a953398eb8e66adbe78fdd2a8fdd09d7.tar.gz
mpd-3965b490a953398eb8e66adbe78fdd2a8fdd09d7.tar.xz
mpd-3965b490a953398eb8e66adbe78fdd2a8fdd09d7.zip
db/Helpers: use reference instead of pointer
-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;
}
}