db/simple: eliminate UpdateFileInArchive() if archive API is disabled

Reduce some unnecessary overhead.
This commit is contained in:
Max Kellermann
2015-03-01 00:25:30 +01:00
parent 77e163e5b8
commit 605af61a0f
2 changed files with 14 additions and 2 deletions

View File

@@ -52,9 +52,13 @@ Song::LoadFile(Storage &storage, const char *path_utf8, Directory &parent)
Song *song = NewFile(path_utf8, parent);
//in archive ?
bool success = parent.device == DEVICE_INARCHIVE
bool success =
#ifdef ENABLE_ARCHIVE
parent.device == DEVICE_INARCHIVE
? song->UpdateFileInArchive(storage)
: song->UpdateFile(storage);
:
#endif
song->UpdateFile(storage);
if (!success) {
song->Free();
return nullptr;
@@ -113,6 +117,10 @@ Song::UpdateFile(Storage &storage)
return true;
}
#endif
#ifdef ENABLE_ARCHIVE
bool
Song::UpdateFileInArchive(const Storage &storage)
{