summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-08-18 21:14:25 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-08-18 21:14:25 +0000
commit4850a45925b5759425ea4f3418ea1a1fed7c10b6 (patch)
treea6f04018b94fbd8e316242ec171771b71084b8f5
parent4c5c12cd38e87e3941abda444628b1ff8324599e (diff)
options_get_number() is relatively expensive and a check for dead panes happens
a lot more often than actually finding one, so instead of getting the option for every check, get it for every dead window found.
-rw-r--r--usr.bin/tmux/server.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c
index 128183b8b22..2cab75dbf63 100644
--- a/usr.bin/tmux/server.c
+++ b/usr.bin/tmux/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.21 2009/08/14 11:23:34 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.22 2009/08/18 21:14:24 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1106,13 +1106,12 @@ void
server_check_window(struct window *w)
{
struct window_pane *wp, *wq;
+ struct options *oo = &w->options;
struct client *c;
struct session *s;
struct winlink *wl;
u_int i, j;
- int destroyed, flag;
-
- flag = options_get_number(&w->options, "remain-on-exit");
+ int destroyed;
destroyed = 1;
@@ -1125,7 +1124,7 @@ server_check_window(struct window *w)
* the window to be destroyed (or it'll close when the last
* pane dies).
*/
- if (wp->fd == -1 && !flag) {
+ if (wp->fd == -1 && options_get_number(oo, "remain-on-exit")) {
layout_close_pane(wp);
window_remove_pane(w, wp);
server_redraw_window(w);