diff options
author | nicm <nicm> | 2014-05-14 06:21:19 +0000 |
---|---|---|
committer | nicm <nicm> | 2014-05-14 06:21:19 +0000 |
commit | 53cbae544f79daede0f9457f31947f5d001ac788 (patch) | |
tree | 5eb5e06ff6f12b1dda86a4d1a219e24c7bf7cb53 /key-bindings.c | |
parent | b2e791b574a60e481d2a5813157ab00cb99cc32f (diff) |
Now that cmdlists are reference counted, there is no need for two-step
deletion via the dead_key_bindings tree. From Keith Amling.
Diffstat (limited to 'key-bindings.c')
-rw-r--r-- | key-bindings.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/key-bindings.c b/key-bindings.c index db48f9e7..55c8aebe 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -27,7 +27,6 @@ RB_GENERATE(key_bindings, key_binding, entry, key_bindings_cmp); struct key_bindings key_bindings; -struct key_bindings dead_key_bindings; int key_bindings_cmp(struct key_binding *bd1, struct key_binding *bd2) @@ -78,20 +77,8 @@ key_bindings_remove(int key) if ((bd = key_bindings_lookup(key)) == NULL) return; RB_REMOVE(key_bindings, &key_bindings, bd); - RB_INSERT(key_bindings, &dead_key_bindings, bd); -} - -void -key_bindings_clean(void) -{ - struct key_binding *bd; - - while (!RB_EMPTY(&dead_key_bindings)) { - bd = RB_ROOT(&dead_key_bindings); - RB_REMOVE(key_bindings, &dead_key_bindings, bd); - cmd_list_free(bd->cmdlist); - free(bd); - } + cmd_list_free(bd->cmdlist); + free(bd); } void |