Explorar el Código

Simplify while loop into for loop

Samuel Thibault hace 5 años
padre
commit
870f1a312e
Se han modificado 1 ficheros con 1 adiciones y 5 borrados
  1. 1 5
      src/sched_policies/fifo_queues.c

+ 1 - 5
src/sched_policies/fifo_queues.c

@@ -385,11 +385,9 @@ struct starpu_task *_starpu_fifo_pop_first_ready_task(struct _starpu_fifo_taskq
 
 		int first_task_priority = task->priority;
 
-		current = task;
-
 		int non_ready_best = INT_MAX;
 
-		while (current)
+		for (current = task; current; current = current->next)
 		{
 			int priority = current->priority;
 
@@ -405,8 +403,6 @@ struct starpu_task *_starpu_fifo_pop_first_ready_task(struct _starpu_fifo_taskq
 						break;
 				}
 			}
-
-			current = current->next;
 		}
 
 		if(num_priorities != -1)