Verified Commit d7d78164 authored by Erick Hitter's avatar Erick Hitter
Browse files

Switch to a do-while loop, since we know we always want at least one run of the loop

parent 21b98592
......@@ -144,7 +144,7 @@ class Events extends Singleton {
$i = 1; // Intentionally not zero-indexed to facilitate comparisons against $action_counts members
while ( $i <= 15 && count( $reduced_queue ) < JOB_QUEUE_SIZE && ! empty( $events ) ) {
do {
// Each time the events array is iterated over, move one instance of an action to the current queue
foreach ( $events as $key => $event ) {
$action = $event['action'];
......@@ -171,7 +171,7 @@ class Events extends Singleton {
continue;
}
}
} while( $i <= 15 && count( $reduced_queue ) < JOB_QUEUE_SIZE && ! empty( $events ) );
/**
* IMPORTANT: DO NOT re-sort the $reduced_queue array from this point forward.
......
Supports Markdown
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