summaryrefslogtreecommitdiff
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2022-08-05 12:34:47 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2022-08-05 12:34:47 -0400
commit0da97d66852a0ab3abd3b4116825338636ac9367 (patch)
tree233be69e672026f8e8243c8204fffe38a9be581d /src/keyboard.c
parenteb7fe81e6db8d630521098a728713e10c9d59c74 (diff)
downloademacs-0da97d66852a0ab3abd3b4116825338636ac9367.tar.gz
* src/keyboard.c (timer_check_2): Replace redundant test with assertion
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 02e02448ff8..81e73a28333 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4642,27 +4642,27 @@ timer_check_2 (Lisp_Object timers, Lisp_Object idle_timers)
/* If timer is ripe, run it if it hasn't been run. */
if (ripe)
{
- if (NILP (AREF (chosen_timer, 0)))
- {
- specpdl_ref count = SPECPDL_INDEX ();
- Lisp_Object old_deactivate_mark = Vdeactivate_mark;
+ /* If we got here, presumably `decode_timer` has checked
+ that this timer has not yet been triggered. */
+ eassert (NILP (AREF (chosen_timer, 0)));
+ specpdl_ref count = SPECPDL_INDEX ();
+ Lisp_Object old_deactivate_mark = Vdeactivate_mark;
- /* Mark the timer as triggered to prevent problems if the lisp
- code fails to reschedule it right. */
- ASET (chosen_timer, 0, Qt);
+ /* Mark the timer as triggered to prevent problems if the lisp
+ code fails to reschedule it right. */
+ ASET (chosen_timer, 0, Qt);
- specbind (Qinhibit_quit, Qt);
+ specbind (Qinhibit_quit, Qt);
- call1 (Qtimer_event_handler, chosen_timer);
- Vdeactivate_mark = old_deactivate_mark;
- timers_run++;
- unbind_to (count, Qnil);
+ call1 (Qtimer_event_handler, chosen_timer);
+ Vdeactivate_mark = old_deactivate_mark;
+ timers_run++;
+ unbind_to (count, Qnil);
- /* Since we have handled the event,
- we don't need to tell the caller to wake up and do it. */
- /* But the caller must still wait for the next timer, so
- return 0 to indicate that. */
- }
+ /* Since we have handled the event,
+ we don't need to tell the caller to wake up and do it. */
+ /* But the caller must still wait for the next timer, so
+ return 0 to indicate that. */
nexttime = make_timespec (0, 0);
break;