From 35d803bc9a0d21c36b1381f6e42455beeb73b715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 28 Jan 2017 22:40:58 +0100 Subject: use SWAP macro Apply the semantic patch swap.cocci to convert hand-rolled swaps to use the macro SWAP. The resulting code is shorter and easier to read, the object code is effectively unchanged. The patch for object.c had to be hand-edited in order to preserve the comment before the change; Coccinelle tried to eat it for some reason. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- merge-recursive.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'merge-recursive.c') diff --git a/merge-recursive.c b/merge-recursive.c index d32720944..b7ff1ada3 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -1390,14 +1390,11 @@ static int process_renames(struct merge_options *o, branch1 = o->branch1; branch2 = o->branch2; } else { - struct rename *tmp; renames1 = b_renames; renames2Dst = &a_by_dst; branch1 = o->branch2; branch2 = o->branch1; - tmp = ren2; - ren2 = ren1; - ren1 = tmp; + SWAP(ren2, ren1); } if (ren1->processed) -- cgit v1.2.1