diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-06 14:10:32 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-06 14:10:32 +0000 |
commit | ca1ee217023b431bac179023c2b70e13427c4ab0 (patch) | |
tree | 8fbc261392ff2e39f7a5d19594da2c2b0c248fee /cmd-list-keys.c | |
parent | ac3fe6512f47e72ba108e04392d1f2e548774af9 (diff) |
Switch to splay tree for key bindings.
Diffstat (limited to 'cmd-list-keys.c')
-rw-r--r-- | cmd-list-keys.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/cmd-list-keys.c b/cmd-list-keys.c index 9dba321e..299681b9 100644 --- a/cmd-list-keys.c +++ b/cmd-list-keys.c @@ -1,4 +1,4 @@ -/* $Id: cmd-list-keys.c,v 1.10 2008-06-05 21:25:00 nicm Exp $ */ +/* $Id: cmd-list-keys.c,v 1.11 2009-01-06 14:10:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -42,13 +42,11 @@ const struct cmd_entry cmd_list_keys_entry = { void cmd_list_keys_exec(unused struct cmd *self, struct cmd_ctx *ctx) { - struct binding *bd; - const char *key; - char s[BUFSIZ]; - u_int i; + struct key_binding *bd; + const char *key; + char s[BUFSIZ]; - for (i = 0; i < ARRAY_LENGTH(&key_bindings); i++) { - bd = ARRAY_ITEM(&key_bindings, i); + SPLAY_FOREACH(bd, key_bindings, &key_bindings) { if ((key = key_string_lookup_key(bd->key)) == NULL) continue; if (bd->cmd->entry->print == NULL) { |