summaryrefslogtreecommitdiffstats
path: root/key-bindings.c
diff options
context:
space:
mode:
authornicm <nicm>2016-03-01 12:06:07 +0000
committernicm <nicm>2016-03-01 12:06:07 +0000
commitf0239a8fe97367ce7ab66d18716c411b424a0e63 (patch)
tree13bc7da30a4bfe0833a3a3a655a90e6fc4b97b4b /key-bindings.c
parent2e4503ad4eec5422e6425480681a261258f7e940 (diff)
Remove some more unused variables, and use RB_FOREACH_SAFE in
key_bindings_unref_table.
Diffstat (limited to 'key-bindings.c')
-rw-r--r--key-bindings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/key-bindings.c b/key-bindings.c
index a922eb18..0d13385d 100644
--- a/key-bindings.c
+++ b/key-bindings.c
@@ -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);