summaryrefslogtreecommitdiff
path: root/diff-no-index.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2017-01-28 22:40:58 +0100
committerJunio C Hamano <gitster@pobox.com>2017-01-30 14:17:00 -0800
commit35d803bc9a0d21c36b1381f6e42455beeb73b715 (patch)
tree045fa1fa1b75d7477bcd6e49f9ea2a75a9211732 /diff-no-index.c
parentdb101991414f4e14b3763b4843dddcca6b31b40b (diff)
downloadgit-35d803bc9a0d21c36b1381f6e42455beeb73b715.tar.gz
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 <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-no-index.c')
-rw-r--r--diff-no-index.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/diff-no-index.c b/diff-no-index.c
index f420786039..1ae09894d7 100644
--- a/diff-no-index.c
+++ b/diff-no-index.c
@@ -186,9 +186,8 @@ static int queue_diff(struct diff_options *o,
if (DIFF_OPT_TST(o, REVERSE_DIFF)) {
unsigned tmp;
- const char *tmp_c;
tmp = mode1; mode1 = mode2; mode2 = tmp;
- tmp_c = name1; name1 = name2; name2 = tmp_c;
+ SWAP(name1, name2);
}
d1 = noindex_filespec(name1, mode1);