Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

fix #3958 #3965

Merged
merged 1 commit into from
Oct 13, 2024
Merged

fix #3958 #3965

merged 1 commit into from
Oct 13, 2024

Conversation

knighthat
Copy link

Old algorithm

if (songs.size > maxSongsInQueue.number) 
    songs.shuffled().take(maxSongsInQueue.number.toInt())
else
    songs

Shuffle only happens when number of songs is larger than the queue allows.

New algorithm

songs.shuffled().take( maxSongsInQueue )

Shuffle regardless. Besides, List#take will take up to specified number, if list's size is smaller, it'll return all elements, no need to check

@fast4x fast4x merged commit 0ff9428 into fast4x:master Oct 13, 2024
@knighthat knighthat deleted the issue-3958 branch October 19, 2024 18:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants