os/WaitFor: Use the simpler xorg_list_for_each_entry()
As we are not freeing elements while iterating the list of timers, we can forgo using the safe variant, and reduce the number of pointer dances required for the insertion sort. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
6115d8b40c
commit
1e9d5533e3
|
@ -295,7 +295,7 @@ OsTimerPtr
|
||||||
TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
|
TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
|
||||||
OsTimerCallback func, void *arg)
|
OsTimerCallback func, void *arg)
|
||||||
{
|
{
|
||||||
OsTimerPtr existing, tmp;
|
OsTimerPtr existing;
|
||||||
CARD32 now = GetTimeInMillis();
|
CARD32 now = GetTimeInMillis();
|
||||||
|
|
||||||
if (!timer) {
|
if (!timer) {
|
||||||
|
@ -328,7 +328,7 @@ TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
|
||||||
input_lock();
|
input_lock();
|
||||||
|
|
||||||
/* Sort into list */
|
/* Sort into list */
|
||||||
xorg_list_for_each_entry_safe(existing, tmp, &timers, list)
|
xorg_list_for_each_entry(existing, &timers, list)
|
||||||
if ((int) (existing->expires - millis) > 0)
|
if ((int) (existing->expires - millis) > 0)
|
||||||
break;
|
break;
|
||||||
/* This even works at the end of the list -- existing->list will be timers */
|
/* This even works at the end of the list -- existing->list will be timers */
|
||||||
|
|
Loading…
Reference in New Issue