SongUpdate: make variables more local
This commit is contained in:
parent
e4322a716c
commit
ad309cdeae
@ -44,21 +44,16 @@
|
|||||||
Song *
|
Song *
|
||||||
Song::LoadFile(const char *path_utf8, Directory &parent)
|
Song::LoadFile(const char *path_utf8, Directory &parent)
|
||||||
{
|
{
|
||||||
Song *song;
|
|
||||||
bool ret;
|
|
||||||
|
|
||||||
assert(!uri_has_scheme(path_utf8));
|
assert(!uri_has_scheme(path_utf8));
|
||||||
assert(strchr(path_utf8, '\n') == nullptr);
|
assert(strchr(path_utf8, '\n') == nullptr);
|
||||||
|
|
||||||
song = NewFile(path_utf8, parent);
|
Song *song = NewFile(path_utf8, parent);
|
||||||
|
|
||||||
//in archive ?
|
//in archive ?
|
||||||
if (parent.device == DEVICE_INARCHIVE) {
|
bool success = parent.device == DEVICE_INARCHIVE
|
||||||
ret = song->UpdateFileInArchive();
|
? song->UpdateFileInArchive()
|
||||||
} else {
|
: song->UpdateFile();
|
||||||
ret = song->UpdateFile();
|
if (!success) {
|
||||||
}
|
|
||||||
if (!ret) {
|
|
||||||
song->Free();
|
song->Free();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user