db/simple/Song: make "parent" a reference, not a pointer

This commit is contained in:
Max Kellermann
2014-08-12 15:38:59 +02:00
parent 1bfede120a
commit f4d0bd8205
6 changed files with 15 additions and 17 deletions

View File

@@ -167,7 +167,7 @@ Directory::AddSong(SongPtr song) noexcept
{
assert(holding_db_lock());
assert(song != nullptr);
assert(song->parent == this);
assert(&song->parent == this);
songs.push_back(*song.release());
}
@@ -177,7 +177,7 @@ Directory::RemoveSong(Song *song) noexcept
{
assert(holding_db_lock());
assert(song != nullptr);
assert(song->parent == this);
assert(&song->parent == this);
songs.erase(songs.iterator_to(*song));
}
@@ -189,7 +189,7 @@ Directory::FindSong(const char *name_utf8) const noexcept
assert(name_utf8 != nullptr);
for (auto &song : songs) {
assert(song.parent == this);
assert(&song.parent == this);
if (song.uri == name_utf8)
return &song;