diff options
author | nicm <nicm> | 2015-01-15 13:43:13 +0000 |
---|---|---|
committer | nicm <nicm> | 2015-01-15 13:43:13 +0000 |
commit | 6e764fb53e7665d723d0ac58ec32c5b608f9c713 (patch) | |
tree | 91238c8471a5139a6cc9f4a7dc47e3a661b5d976 | |
parent | 86207ee676af4fc64f6e289d824460800f43194e (diff) | |
download | rtmux-6e764fb53e7665d723d0ac58ec32c5b608f9c713.tar.gz rtmux-6e764fb53e7665d723d0ac58ec32c5b608f9c713.tar.bz2 rtmux-6e764fb53e7665d723d0ac58ec32c5b608f9c713.zip |
Remove an unnecessary variable and shorten a line.
-rw-r--r-- | window-choose.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/window-choose.c b/window-choose.c index 56016394..0d724746 100644 --- a/window-choose.c +++ b/window-choose.c @@ -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 |