diff options
author | Max Kellermann <max@duempel.org> | 2008-09-18 23:35:12 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-18 23:35:12 +0200 |
commit | 479c19084abdafb4fbc4217c5664f6d1ab65e12e (patch) | |
tree | db9456310018f737f0d9e01a0609f1c54b763894 /src/screen_browser.c | |
parent | cb2ec6826f7646ec3a5cf430fdda8b8249cb8f4b (diff) | |
download | mpd-479c19084abdafb4fbc4217c5664f6d1ab65e12e.tar.gz mpd-479c19084abdafb4fbc4217c5664f6d1ab65e12e.tar.xz mpd-479c19084abdafb4fbc4217c5664f6d1ab65e12e.zip |
screen_browser: removed entity.song!=NULL check
It is guaranteed that the "song" attribute is not NULL, remove the
check.
Diffstat (limited to 'src/screen_browser.c')
-rw-r--r-- | src/screen_browser.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/screen_browser.c b/src/screen_browser.c index f3ec8eda6..0a06e5fb3 100644 --- a/src/screen_browser.c +++ b/src/screen_browser.c @@ -358,6 +358,8 @@ browser_select_entry(mpdclient_t *c, filelist_entry_t *entry, if (entry->entity->type != MPD_INFO_ENTITY_TYPE_SONG) return -1; + assert(entry->entity->info.song != NULL); + if (!toggle || (entry->flags & HIGHLIGHT) == 0) { mpd_Song *song = entry->entity->info.song; @@ -372,15 +374,12 @@ browser_select_entry(mpdclient_t *c, filelist_entry_t *entry, } else { /* remove song from playlist */ mpd_Song *song = entry->entity->info.song; + int idx; entry->flags &= ~HIGHLIGHT; - if (song) { - int idx; - - while ((idx = playlist_get_index_from_file(c, song->file)) >=0) - mpdclient_cmd_delete(c, idx); - } + while ((idx = playlist_get_index_from_file(c, song->file)) >=0) + mpdclient_cmd_delete(c, idx); } return 0; |