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

@@ -109,12 +109,11 @@ Song::LoadFromArchive(ArchiveFile &archive, const char *name_utf8,
bool
Song::UpdateFileInArchive(ArchiveFile &archive) noexcept
{
assert(parent != nullptr);
assert(parent->device == DEVICE_INARCHIVE);
assert(parent.device == DEVICE_INARCHIVE);
std::string path_utf8(uri);
for (const Directory *directory = parent;
for (const Directory *directory = &parent;
directory->parent != nullptr &&
directory->parent->device == DEVICE_INARCHIVE;
directory = directory->parent) {