aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-07-25 12:52:36 +0200
committerMax Kellermann <max@duempel.org>2010-07-25 13:28:48 +0200
commit8341a9f7b24bfc10879eb5ec68a6d531738a2cc2 (patch)
tree687267d402bee4adfd7ed2fd1f7164c4871ee9c0
parentb233c145fa28f2a9e90a40993bc35f408d256e08 (diff)
downloadmpd-8341a9f7b24bfc10879eb5ec68a6d531738a2cc2.tar.gz
mpd-8341a9f7b24bfc10879eb5ec68a6d531738a2cc2.tar.xz
mpd-8341a9f7b24bfc10879eb5ec68a6d531738a2cc2.zip
queue_save: simplify get_song()
Don't try db_get_song() if the URI has a scheme.
Diffstat (limited to '')
-rw-r--r--src/queue_save.c13
1 files 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