diff options
author | Max Kellermann <max@duempel.org> | 2014-02-06 18:58:24 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-06 18:58:56 +0100 |
commit | ad309cdeae3531abb14529d04fc43062a4385388 (patch) | |
tree | 9667f65a289a6caeee85b27a2f24b316d34f2564 /src/SongUpdate.cxx | |
parent | e4322a716c178ffa74bd56542ea6214c4d6845bb (diff) |
SongUpdate: make variables more local
Diffstat (limited to 'src/SongUpdate.cxx')
-rw-r--r-- | src/SongUpdate.cxx | 15 |
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; } |