From ca1ee217023b431bac179023c2b70e13427c4ab0 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 6 Jan 2009 14:10:32 +0000 Subject: Switch to splay tree for key bindings. --- cmd-list-keys.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'cmd-list-keys.c') 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 @@ -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) { -- cgit