From a4ac1538fa56ba05d91911fa91b1287c75e74ba8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 18 Oct 2009 02:00:01 +0200 Subject: [PATCH] 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. --- src/playlist.h | 6 ------ 1 file changed, 6 deletions(-) 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; -- 2.30.2