Code

screen_artist: don't use filelist_prepend()
authorMax Kellermann <max@duempel.org>
Sat, 3 Oct 2009 16:28:18 +0000 (18:28 +0200)
committerMax Kellermann <max@duempel.org>
Sat, 3 Oct 2009 16:28:18 +0000 (18:28 +0200)
filelist_prepend() is quite expensive.  Let's insert the NULL entry
first, and append all entries while they are received.

src/screen_artist.c

index 95e4d2236683e4dfcb60cda029e5b3433a643fba..e88a04dbd0571b9bd689be52830f8d37c72da893 100644 (file)
@@ -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);