From ce1f053617188441fcc0643d0398f05888f8c63c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 3 Oct 2009 18:28:18 +0200 Subject: [PATCH] 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. --- src/screen_artist.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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); -- 2.30.2