From 8341a9f7b24bfc10879eb5ec68a6d531738a2cc2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 25 Jul 2010 12:52:36 +0200 Subject: queue_save: simplify get_song() Don't try db_get_song() if the URI has a scheme. --- src/queue_save.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/queue_save.c b/src/queue_save.c index 16561537d..b09f1ecc0 100644 --- a/src/queue_save.c +++ b/src/queue_save.c @@ -45,16 +45,9 @@ queue_save(FILE *fp, const struct queue *queue) static struct song * get_song(const char *uri) { - struct song *song; - - song = db_get_song(uri); - if (song != NULL) - return song; - - if (uri_has_scheme(uri)) - return song_remote_new(uri); - - return NULL; + return uri_has_scheme(uri) + ? song_remote_new(uri) + : db_get_song(uri); } void -- cgit v1.2.3