playlist_queue: simplify error handler

Return early on error, save one level of indent.
This commit is contained in:
Max Kellermann
2010-06-25 22:01:18 +02:00
parent 68f75955d8
commit fba13bd5d2

@ -103,16 +103,15 @@ playlist_open_into_queue(const char *uri, struct playlist *dest)
struct input_stream *is; struct input_stream *is;
struct playlist_provider *playlist = playlist_mapper_open(uri, &is); struct playlist_provider *playlist = playlist_mapper_open(uri, &is);
if (playlist != NULL) { if (playlist == NULL)
enum playlist_result result = return PLAYLIST_RESULT_NO_SUCH_LIST;
playlist_load_into_queue(uri, playlist, dest);
playlist_plugin_close(playlist);
if (is != NULL) enum playlist_result result =
input_stream_close(is); playlist_load_into_queue(uri, playlist, dest);
playlist_plugin_close(playlist);
return result; if (is != NULL)
} input_stream_close(is);
return PLAYLIST_RESULT_NO_SUCH_LIST; return result;
} }