From: Max Kellermann Date: Tue, 29 Sep 2009 20:01:37 +0000 (+0200) Subject: playlist: don't check mpd_song_get_uri()!=NULL X-Git-Tag: release-0.16~300 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=eddd0337ce1be0ea944aecbef50e396deec88f9b;p=ncmpc.git playlist: don't check mpd_song_get_uri()!=NULL libmpdclient2 guarantees that each mpd_song object has an URI. --- 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; }