Skip to content
Snippets Groups Projects
Commit aaa76d4d authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

fix indexing errror.

parent b1bbc924
No related branches found
No related tags found
No related merge requests found
...@@ -89,9 +89,9 @@ int queue_get ( struct queue *q , struct qsched *s , int insist ) { ...@@ -89,9 +89,9 @@ int queue_get ( struct queue *q , struct qsched *s , int insist ) {
/* Fix the heap. */ /* Fix the heap. */
w = tasks[ inds[k] ].weight; w = tasks[ inds[k] ].weight;
if ( k > 0 && w > tasks[ inds[k/2] ].weight ) if ( k > 0 && w > tasks[ inds[(k-1)/2] ].weight )
while ( k > 0 ) { while ( k > 0 ) {
j = k / 2; j = (k - 1) / 2;
if ( w > tasks[ inds[j] ].weight ) { if ( w > tasks[ inds[j] ].weight ) {
temp = inds[j]; temp = inds[j];
inds[j] = inds[k]; inds[j] = inds[k];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment