aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-18 23:35:12 +0200
committerMax Kellermann <max@duempel.org>2008-09-18 23:35:12 +0200
commiteb04b19e0eaa2554f573837f5597f73f01dba318 (patch)
tree9c68e84450e033f7d44d60ad0d84fd1844e04e78 /src
parent860824f958bf3cad703b67ee612f1ae5b5e1957f (diff)
downloadmpd-eb04b19e0eaa2554f573837f5597f73f01dba318.tar.gz
mpd-eb04b19e0eaa2554f573837f5597f73f01dba318.tar.xz
mpd-eb04b19e0eaa2554f573837f5597f73f01dba318.zip
screen_browser: removed redundant entity type checks
The function browser_select_entry() returns early when the entity type is not "SONG". No need to double check that.
Diffstat (limited to 'src')
-rw-r--r--src/screen_browser.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/screen_browser.c b/src/screen_browser.c
index 8e899fcbf..b9ef7d4e7 100644
--- a/src/screen_browser.c
+++ b/src/screen_browser.c
@@ -364,27 +364,23 @@ browser_select_entry(mpdclient_t *c, filelist_entry_t *entry,
entry->flags |= HIGHLIGHT;
if (toggle || entry->flags & HIGHLIGHT) {
- if (entry->entity->type == MPD_INFO_ENTITY_TYPE_SONG) {
- mpd_Song *song = entry->entity->info.song;
+ mpd_Song *song = entry->entity->info.song;
- if (mpdclient_cmd_add(c, song) == 0) {
- char buf[BUFSIZE];
+ if (mpdclient_cmd_add(c, song) == 0) {
+ char buf[BUFSIZE];
- strfsong(buf, BUFSIZE, LIST_FORMAT, song);
- screen_status_printf(_("Adding \'%s\' to playlist\n"), buf);
- }
+ strfsong(buf, BUFSIZE, LIST_FORMAT, song);
+ screen_status_printf(_("Adding \'%s\' to playlist\n"), buf);
}
} else {
/* remove song from playlist */
- if (entry->entity->type == MPD_INFO_ENTITY_TYPE_SONG) {
- mpd_Song *song = entry->entity->info.song;
+ mpd_Song *song = entry->entity->info.song;
- if (song) {
- int idx;
+ 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);
}
}