summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: adf872e)
raw | patch | inline | side by side (parent: adf872e)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Sun, 16 Jan 2011 01:08:42 +0000 (19:08 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 16 Jan 2011 04:34:14 +0000 (20:34 -0800) |
As long as sizeof(struct ll_merge_options) is small, there is not
much reason not to keep a copy of the default merge options in the BSS
section. In return, we get clearer code and one less stack frame in
the opts == NULL case.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
much reason not to keep a copy of the default merge options in the BSS
section. In return, we get clearer code and one less stack frame in
the opts == NULL case.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ll-merge.c | patch | blob | history |
diff --git a/ll-merge.c b/ll-merge.c
index 007dd3e4d38ff657a29a06e559173b796f193763..6ce512efc4cce8042481e8a6947d033c272e78e6 100644 (file)
--- a/ll-merge.c
+++ b/ll-merge.c
const struct ll_merge_options *opts)
{
static struct git_attr_check check[2];
+ static const struct ll_merge_options default_opts;
const char *ll_driver_name = NULL;
int marker_size = DEFAULT_CONFLICT_MARKER_SIZE;
const struct ll_merge_driver *driver;
- if (!opts) {
- struct ll_merge_options default_opts = {0};
- return ll_merge(result_buf, path, ancestor, ancestor_label,
- ours, our_label, theirs, their_label,
- &default_opts);
- }
+ if (!opts)
+ opts = &default_opts;
if (opts->renormalize) {
normalize_file(ancestor, path);