From 42332b8f0bb93bfe607a85f42a8a0e508f4ef227 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonathan=20Neusch=C3=A4fer?= Date: Tue, 22 Nov 2011 23:09:35 +0100 Subject: [PATCH] command.c: use for instead of while in check_key_bindings --- src/command.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/command.c b/src/command.c index 67e0ad3..2b58617 100644 --- a/src/command.c +++ b/src/command.c @@ -482,19 +482,16 @@ assign_keys(command_t command, int keys[MAX_COMMAND_KEYS]) int check_key_bindings(command_definition_t *cp, char *buf, size_t bufsize) { - int i = 0; + int i; int retval = 0; if (cp == NULL) cp = cmds; - while (cp[i].name) { + for (i = 0; cp[i].name; i++) cp[i].flags &= ~COMMAND_KEY_CONFLICT; - i++; - } - i = 0; - while (cp[i].name) { + for (i = 0; cp[i].name; i++) { int j; command_t cmd; @@ -520,8 +517,8 @@ check_key_bindings(command_definition_t *cp, char *buf, size_t bufsize) retval = -1; } } - i++; } + return retval; } -- 2.30.2