aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/SongUpdate.cxx15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/SongUpdate.cxx b/src/SongUpdate.cxx
index 665783279..04bab5d1e 100644
--- a/src/SongUpdate.cxx
+++ b/src/SongUpdate.cxx
@@ -44,21 +44,16 @@
Song *
Song::LoadFile(const char *path_utf8, Directory &parent)
{
- Song *song;
- bool ret;
-
assert(!uri_has_scheme(path_utf8));
assert(strchr(path_utf8, '\n') == nullptr);
- song = NewFile(path_utf8, parent);
+ Song *song = NewFile(path_utf8, parent);
//in archive ?
- if (parent.device == DEVICE_INARCHIVE) {
- ret = song->UpdateFileInArchive();
- } else {
- ret = song->UpdateFile();
- }
- if (!ret) {
+ bool success = parent.device == DEVICE_INARCHIVE
+ ? song->UpdateFileInArchive()
+ : song->UpdateFile();
+ if (!success) {
song->Free();
return nullptr;
}