From: Jonathan Neuschäfer Date: Tue, 22 Nov 2011 22:09:35 +0000 (+0100) Subject: command.c: use for instead of while in check_key_bindings X-Git-Tag: release-0.20~48 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=42332b8f0bb93bfe607a85f42a8a0e508f4ef227;p=ncmpc.git command.c: use for instead of while in check_key_bindings --- 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; }