Skip to content

Commit

Permalink
Remove some more unused variables, and use RB_FOREACH_SAFE in
Browse files Browse the repository at this point in the history
key_bindings_unref_table.
  • Loading branch information
nicm committed Mar 1, 2016
1 parent 2e4503a commit f0239a8
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions cmd-if-shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,13 @@ cmd_if_shell_exec(struct cmd *self, struct cmd_q *cmdq)
struct format_tree *ft;
const char *cwd;

cwd = wp->cwd;

if (cmdq->client != NULL && cmdq->client->session == NULL)
cwd = cmdq->client->cwd;
else if (s != NULL)
cwd = s->cwd;
else
cwd = NULL;

ft = format_create(cmdq, 0);
format_defaults(ft, NULL, s, wl, wp);
shellcmd = format_expand(ft, args->argv[0]);
Expand Down
1 change: 0 additions & 1 deletion cmd-resize-pane.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ cmd_resize_pane_exec(struct cmd *self, struct cmd_q *cmdq)
return (CMD_RETURN_NORMAL);
}

w = wl->window;
if (args_has(args, 'Z')) {
if (w->flags & WINDOW_ZOOMED)
window_unzoom(w);
Expand Down
1 change: 0 additions & 1 deletion cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,6 @@ cmd_prepare_state_flag(char c, const char *target, enum cmd_entry_flag flag,
CMD_FIND_SESSION, CMD_FIND_QUIET);
if (error == 0)
break;
flag = CMD_WINDOW_INDEX;
/* FALLTHROUGH */
case CMD_WINDOW:
case CMD_WINDOW_CANFAIL:
Expand Down
4 changes: 2 additions & 2 deletions key-bindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ void
key_bindings_unref_table(struct key_table *table)
{
struct key_binding *bd;
struct key_binding *bd1;

if (--table->references != 0)
return;

while (!RB_EMPTY(&table->key_bindings)) {
bd = RB_ROOT(&table->key_bindings);
RB_FOREACH_SAFE(bd, key_bindings, &table->key_bindings, bd1) {
RB_REMOVE(key_bindings, &table->key_bindings, bd);
cmd_list_free(bd->cmdlist);
free(bd);
Expand Down

0 comments on commit f0239a8

Please sign in to comment.