aboutsummaryrefslogtreecommitdiffstats
path: root/src/SongUpdate.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-06 18:58:24 +0100
committerMax Kellermann <max@duempel.org>2014-02-06 18:58:56 +0100
commitad309cdeae3531abb14529d04fc43062a4385388 (patch)
tree9667f65a289a6caeee85b27a2f24b316d34f2564 /src/SongUpdate.cxx
parente4322a716c178ffa74bd56542ea6214c4d6845bb (diff)
downloadmpd-ad309cdeae3531abb14529d04fc43062a4385388.tar.gz
mpd-ad309cdeae3531abb14529d04fc43062a4385388.tar.xz
mpd-ad309cdeae3531abb14529d04fc43062a4385388.zip
SongUpdate: make variables more local
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;
}