From: Max Kellermann Date: Sun, 18 Oct 2009 00:00:01 +0000 (+0200) Subject: playlist: don't update the song positions in playlist_swap() X-Git-Tag: release-0.16~85 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a4ac1538fa56ba05d91911fa91b1287c75e74ba8;p=ncmpc.git playlist: don't update the song positions in playlist_swap() In ncmpc, nobody reads the song's "position" attribute (except for the "plchanges" handler). We don't need it, and we don't need to update it after a swap. --- diff --git a/src/playlist.h b/src/playlist.h index 6f54736..4504688 100644 --- a/src/playlist.h +++ b/src/playlist.h @@ -107,12 +107,6 @@ playlist_swap(struct mpdclient_playlist *playlist, guint idx1, guint idx2) { struct mpd_song *song1 = playlist_get(playlist, idx1); struct mpd_song *song2 = playlist_get(playlist, idx2); - int n; - - /* update the songs position field */ - n = mpd_song_get_pos(song1); - mpd_song_set_pos(song1, mpd_song_get_pos(song2)); - mpd_song_set_pos(song2, n); /* update the array */ g_ptr_array_index(playlist->list, idx1) = song2;