From: nicm Date: Thu, 15 Jan 2015 13:43:13 +0000 (+0000) Subject: Remove an unnecessary variable and shorten a line. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=abb428698984c1e4fa40f228cd100678bdf0957e;p=openbsd Remove an unnecessary variable and shorten a line. --- diff --git a/usr.bin/tmux/window-choose.c b/usr.bin/tmux/window-choose.c index 93d1afca4dc..513aed5fd8a 100644 --- a/usr.bin/tmux/window-choose.c +++ b/usr.bin/tmux/window-choose.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window-choose.c,v 1.57 2014/11/30 08:03:29 nicm Exp $ */ +/* $OpenBSD: window-choose.c,v 1.58 2015/01/15 13:43:13 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -330,14 +330,12 @@ window_choose_collapse(struct window_pane *wp, struct session *s) struct window_choose_mode_data *data = wp->modedata; struct window_choose_mode_item *item, *chosen; struct window_choose_data *wcd; - u_int i, pos; + u_int i; ARRAY_DECL(, struct window_choose_mode_item) list_copy; ARRAY_INIT(&list_copy); - pos = data->selected; - - chosen = &ARRAY_ITEM(&data->list, pos); + chosen = &ARRAY_ITEM(&data->list, data->selected); chosen->state &= ~TREE_EXPANDED; /* @@ -353,9 +351,8 @@ window_choose_collapse(struct window_pane *wp, struct session *s) /* We only show the session when collapsed. */ if (wcd->type & TREE_SESSION) { item->state &= ~TREE_EXPANDED; + ARRAY_ADD(&list_copy, *item); - ARRAY_ADD(&list_copy, - ARRAY_ITEM(&data->list, i)); /* * Update the selection to this session item so * we don't end up highlighting a non-existent