Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ng <andrew.ng@sony.com>2020-05-19 16:05:35 +0300
committerJunio C Hamano <gitster@pobox.com>2020-05-20 01:35:46 +0300
commit8777616e4db2868609bc42a4c66cc69d23532dbc (patch)
tree2bf472dd0563ed2c98c8420f0aa8e7fb02738275 /builtin
parentaf6b65d45ef179ed52087e80cb089f6b2349f4ec (diff)
merge: optimization to skip evaluate_result for single strategy
For a merge with a single strategy, the result of evaluate_result() is effectively not used and therefore is not needed, so avoid altogether. On Windows, this optimization can halve the time required to perform a recursive merge of a single commit with the LLVM repo. Signed-off-by: Andrew Ng <andrew.ng@sony.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/merge.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index d127d2225f..826e2c2656 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1629,7 +1629,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
}
merge_was_ok = 1;
}
- cnt = evaluate_result();
+ cnt = (use_strategies_nr > 1) ? evaluate_result() : 0;
if (best_cnt <= 0 || cnt <= best_cnt) {
best_strategy = use_strategies[i]->name;
best_cnt = cnt;