Skip to content

Commit df786f6

Browse files
committed
Merge branch 'sk/merge-filtering-strategies-micro-optim'
Micro optimization. * sk/merge-filtering-strategies-micro-optim: merge: break out of all_strategy loop when strategy is found
2 parents 42423c6 + 0c75692 commit df786f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static struct strategy *get_strategy(const char *name)
188188
for (i = 0; i < main_cmds.cnt; i++) {
189189
int j, found = 0;
190190
struct cmdname *ent = main_cmds.names[i];
191-
for (j = 0; j < ARRAY_SIZE(all_strategy); j++)
191+
for (j = 0; !found && j < ARRAY_SIZE(all_strategy); j++)
192192
if (!strncmp(ent->name, all_strategy[j].name, ent->len)
193193
&& !all_strategy[j].name[ent->len])
194194
found = 1;

0 commit comments

Comments
 (0)