aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/playlist.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/playlist.c b/src/playlist.c
index 5f3c2c21a..b41cfcc4c 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -191,14 +191,14 @@ void initPlaylist() {
}
static int getNextId() {
- static int cur = 0;
+ static int cur = -1;
- while(playlist.idToPosition[cur] != -1) {
+ do {
cur++;
if(cur >= playlist_max_length*PLAYLIST_HASH_MULT) {
cur = 0;
}
- }
+ } while(playlist.idToPosition[cur] != -1);
return cur;
}