playlist: simplified setPlaylistRandomStatus()

Check the old status before assigning.  This saves a temporary
variable.
This commit is contained in:
Max Kellermann 2008-10-08 11:05:02 +02:00
parent b084bc28ed
commit 4a510a2674

View File

@ -1152,11 +1152,11 @@ static void randomizeOrder(int start, int end)
void setPlaylistRandomStatus(bool status)
{
bool statusWas = playlist.random;
if (status == playlist.random)
return;
playlist.random = status;
if (status != statusWas) {
if (playlist.random) {
/*if(playlist_state==PLAYLIST_STATE_PLAY) {
randomizeOrder(playlist.current+1,
@ -1170,7 +1170,6 @@ void setPlaylistRandomStatus(bool status)
}
} else
orderPlaylist();
}
}
void previousSongInPlaylist(void)