From: Max Kellermann Date: Sat, 3 Oct 2009 16:28:18 +0000 (+0200) Subject: screen_artist: don't use filelist_prepend() X-Git-Tag: release-0.16~199 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ce1f053617188441fcc0643d0398f05888f8c63c;p=ncmpc.git screen_artist: don't use filelist_prepend() filelist_prepend() is quite expensive. Let's insert the NULL entry first, and append all entries while they are received. --- diff --git a/src/screen_artist.c b/src/screen_artist.c index 95e4d22..e88a04d 100644 --- a/src/screen_artist.c +++ b/src/screen_artist.c @@ -204,14 +204,15 @@ load_song_list(struct mpdclient *c) MPD_TAG_ALBUM, album); mpd_search_commit(connection); - browser.filelist = filelist_new_recv(connection); + browser.filelist = filelist_new(); + /* add a dummy entry for ".." */ + filelist_append(browser.filelist, NULL); + + filelist_recv(browser.filelist, connection); if (!mpd_response_finish(connection)) mpdclient_handle_error(c); - /* add a dummy entry for ".." */ - filelist_prepend(browser.filelist, NULL); - #ifndef NCMPC_MINI /* fix highlights */ screen_browser_sync_highlights(browser.filelist, &c->playlist);