mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-04 11:40:22 +00:00
(cancel_atimer): Break out of the loop as soon as timer
has been found. Fix bug not computing timer's predecessor.
This commit is contained in:
parent
9172b88ddf
commit
4ab1d4be61
@ -176,7 +176,7 @@ cancel_atimer (timer)
|
|||||||
struct atimer **list = i ? &stopped_atimers : &atimers;
|
struct atimer **list = i ? &stopped_atimers : &atimers;
|
||||||
|
|
||||||
/* See if TIMER is active or stopped. */
|
/* See if TIMER is active or stopped. */
|
||||||
for (t = *list, prev = 0; t && t != timer; t = t->next)
|
for (t = *list, prev = NULL; t && t != timer; prev = t, t = t->next)
|
||||||
;
|
;
|
||||||
|
|
||||||
/* If it is, take it off the its list, and put in on the
|
/* If it is, take it off the its list, and put in on the
|
||||||
@ -191,6 +191,7 @@ cancel_atimer (timer)
|
|||||||
|
|
||||||
t->next = free_atimers;
|
t->next = free_atimers;
|
||||||
free_atimers = t;
|
free_atimers = t;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user