tmux: remove redundant event_del()/evtimer_del()

event_add(3) automatically replaces any pending timeout for an existing
event, making explicit event_del() / evtimer_del() calls immediately
before event_add() / evtimer_add() unnecessary.

OK nicm@
This commit is contained in:
bket
2026-10-16 11:34:49 +00:00
committed by tmux update bot
parent 5965228c1f
commit 00bddc8893
4 changed files with 4 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: input.c,v 1.277 2026/10/14 16:23:43 nicm Exp $ */
/* $OpenBSD: input.c,v 1.278 2026/10/16 11:34:49 bket Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -826,7 +826,6 @@ input_start_ground_timer(struct input_ctx *ictx)
{
struct timeval tv = { .tv_sec = 5, .tv_usec = 0 };
event_del(&ictx->ground_timer);
event_add(&ictx->ground_timer, &tv);
}
@@ -3551,7 +3550,6 @@ input_start_request_timer(struct input_ctx *ictx)
{
struct timeval tv = { .tv_sec = 0, .tv_usec = 100000 };
event_del(&ictx->request_timer);
event_add(&ictx->request_timer, &tv);
}

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: server-client.c,v 1.523 2026/10/16 07:59:06 nicm Exp $ */
/* $OpenBSD: server-client.c,v 1.524 2026/10/16 11:34:49 bket Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1097,7 +1097,6 @@ have_event:
log_debug("click timer started");
tv.tv_sec = KEYC_CLICK_TIMEOUT / 1000;
tv.tv_usec = (KEYC_CLICK_TIMEOUT % 1000) * 1000L;
evtimer_del(&c->click_timer);
evtimer_add(&c->click_timer, &tv);
}
}
@@ -1577,7 +1576,6 @@ try_again:
tv.tv_sec = repeat / 1000;
tv.tv_usec = (repeat % 1000) * 1000L;
evtimer_del(&c->repeat_timer);
evtimer_add(&c->repeat_timer, &tv);
} else {
c->flags &= ~CLIENT_REPEAT;

3
tty.c
View File

@@ -1,4 +1,4 @@
/* $OpenBSD: tty.c,v 1.491 2026/10/16 07:59:06 nicm Exp $ */
/* $OpenBSD: tty.c,v 1.492 2026/10/16 11:34:49 bket Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -330,7 +330,6 @@ tty_start_start_timer(struct tty *tty)
struct timeval tv = { .tv_sec = TTY_QUERY_TIMEOUT };
log_debug("%s: start timer started", c->name);
evtimer_del(&tty->start_timer);
evtimer_add(&tty->start_timer, &tv);
}

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: window.c,v 1.386 2026/10/13 10:21:58 nicm Exp $ */
/* $OpenBSD: window.c,v 1.387 2026/10/16 11:34:49 bket Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -2667,7 +2667,6 @@ window_pane_scrollbar_start_timer(struct window_pane *wp)
"pane-scrollbars-timeout");
tv.tv_sec = delay / 1000;
tv.tv_usec = (delay % 1000) * 1000L;
evtimer_del(&wp->sb_auto_timer);
evtimer_add(&wp->sb_auto_timer, &tv);
}