Commit 53e5139b authored by Max Kellermann's avatar Max Kellermann

Queue: move queue_shuffle_order_first() into the class

parent 2b8ce83c
...@@ -423,10 +423,10 @@ queue::ShuffleOrder() ...@@ -423,10 +423,10 @@ queue::ShuffleOrder()
ShuffleOrderRangeWithPriority(0, length); ShuffleOrderRangeWithPriority(0, length);
} }
static void void
queue_shuffle_order_first(struct queue *queue, unsigned start, unsigned end) queue::ShuffleOrderFirst(unsigned start, unsigned end)
{ {
queue->SwapOrders(start, g_rand_int_range(queue->rand, start, end)); SwapOrders(start, g_rand_int_range(rand, start, end));
} }
void void
...@@ -543,8 +543,7 @@ queue::SetPriority(unsigned position, uint8_t priority, int after_order) ...@@ -543,8 +543,7 @@ queue::SetPriority(unsigned position, uint8_t priority, int after_order)
const unsigned priority_count = const unsigned priority_count =
queue_count_same_priority(this, new_order, priority); queue_count_same_priority(this, new_order, priority);
assert(priority_count >= 1); assert(priority_count >= 1);
queue_shuffle_order_first(this, new_order, ShuffleOrderFirst(new_order, new_order + priority_count);
new_order + priority_count);
return true; return true;
} }
......
...@@ -316,6 +316,8 @@ struct queue { ...@@ -316,6 +316,8 @@ struct queue {
*/ */
void ShuffleOrder(); void ShuffleOrder();
void ShuffleOrderFirst(unsigned start, unsigned end);
/** /**
* Shuffles the virtual order of the last song in the specified * Shuffles the virtual order of the last song in the specified
* (order) range. This is used in random mode after a song has been * (order) range. This is used in random mode after a song has been
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment