From eddd0337ce1be0ea944aecbef50e396deec88f9b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 29 Sep 2009 22:01:37 +0200 Subject: [PATCH] playlist: don't check mpd_song_get_uri()!=NULL libmpdclient2 guarantees that each mpd_song object has an URI. --- src/playlist.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/playlist.c b/src/playlist.c index 38a39ab..713d3c6 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -117,10 +117,9 @@ playlist_get_index_from_file(const struct mpdclient *c, const gchar *filename) guint i; for (i = 0; i < c->playlist.list->len; ++i) { - struct mpd_song *song = playlist_get(&c->playlist, i); - const char *uri = mpd_song_get_uri(song); + const struct mpd_song *song = playlist_get(&c->playlist, i); - if (uri != NULL && strcmp(uri, filename) == 0) + if (strcmp(mpd_song_get_uri(song), filename) == 0) return (gint)i; } -- 2.30.2