mirror of https://github.com/yandex/odyssey.git
machinarium: sort timers after removal
This commit is contained in:
parent
40500d578a
commit
ee52bd22d7
|
@ -118,11 +118,10 @@ int mm_clock_step(mm_clock_t *clock)
|
||||||
list[j] = list[i];
|
list[j] = list[i];
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
qsort(list, clock->timers_count, sizeof(mm_timer_t*),
|
|
||||||
mm_clock_cmp);
|
|
||||||
|
|
||||||
clock->timers.pos -= sizeof(mm_timer_t*) * timers_hit;
|
clock->timers.pos -= sizeof(mm_timer_t*) * timers_hit;
|
||||||
clock->timers_count -= timers_hit;
|
clock->timers_count -= timers_hit;
|
||||||
|
qsort(list, clock->timers_count, sizeof(mm_timer_t*),
|
||||||
|
mm_clock_cmp);
|
||||||
return timers_hit;
|
return timers_hit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue