diff options
author | Alex Riesen <raa.lkml@gmail.com> | 2008-08-28 19:15:33 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-08-28 21:49:55 -0700 |
commit | e321180ed3e22120e30bb350a5adecbe959e1241 (patch) | |
tree | d262d8693b204942da9326d67501df0124680f13 /builtin-merge.c | |
parent | 63e8aea74e992bd8667e35a0e646110acc1f0d7c (diff) | |
download | git-e321180ed3e22120e30bb350a5adecbe959e1241.tar.gz |
Remove calculation of the longest command name from where it is not used
Just calculate it where it is needed - it is cheap and trivial,
as all the lengths are already there (stored when creating the
command lists).
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-merge.c')
-rw-r--r-- | builtin-merge.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin-merge.c b/builtin-merge.c index d6bcbec705..dcd08f76b1 100644 --- a/builtin-merge.c +++ b/builtin-merge.c @@ -80,7 +80,7 @@ static struct strategy *get_strategy(const char *name) int i; struct strategy *ret; static struct cmdnames main_cmds, other_cmds; - static int longest; + static int loaded; if (!name) return NULL; @@ -89,14 +89,14 @@ static struct strategy *get_strategy(const char *name) if (!strcmp(name, all_strategy[i].name)) return &all_strategy[i]; - if (!longest) { + if (!loaded) { struct cmdnames not_strategies; + loaded = 1; memset(&main_cmds, 0, sizeof(struct cmdnames)); memset(&other_cmds, 0, sizeof(struct cmdnames)); memset(¬_strategies, 0, sizeof(struct cmdnames)); - longest = load_command_list("git-merge-", &main_cmds, - &other_cmds); + load_command_list("git-merge-", &main_cmds, &other_cmds); for (i = 0; i < main_cmds.cnt; i++) { int j, found = 0; struct cmdname *ent = main_cmds.names[i]; |