TagAny, playlist/Mapper: use if with initializer

This commit is contained in:
Max Kellermann
2024-05-15 14:59:41 +02:00
parent a701da6386
commit 4e7b554605
2 changed files with 7 additions and 15 deletions

View File

@@ -40,11 +40,8 @@ playlist_open_in_storage(const char *uri, const Storage *storage, Mutex &mutex)
if (storage == nullptr)
return nullptr;
{
const auto path = storage->MapFS(uri);
if (!path.IsNull())
return playlist_open_path(path, mutex);
}
if (const auto path = storage->MapFS(uri); !path.IsNull())
return playlist_open_path(path, mutex);
const auto uri2 = storage->MapUTF8(uri);
return playlist_open_remote(uri2.c_str(), mutex);