Skip to content

Commit

Permalink
Use 'found' variable instead of break, as suggested in review
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Sep 24, 2017
1 parent 2128fd2 commit 0331365
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions keynav.c
Original file line number Diff line number Diff line change
Expand Up @@ -1712,7 +1712,7 @@ void handle_commands(char *commands) {
g_ptr_array_add(active_recording->commands, (gpointer) strdup(tok));
}

for (i = 0; dispatch[i].command; i++) {
for (i = 0; dispatch[i].command && !found; i++) {
/* XXX: This approach means we can't have one command be a subset of
* another. For example, 'grid' and 'grid-foo' will fail because when you
* use 'grid-foo' it'll match 'grid' first.
Expand All @@ -1736,7 +1736,6 @@ void handle_commands(char *commands) {

found = 1;
dispatch[i].func(args);
break;
}
}

Expand Down

0 comments on commit 0331365

Please sign in to comment.