summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--diff-no-index.c3
-rw-r--r--diff.c4
2 files changed, 2 insertions, 5 deletions
diff --git a/diff-no-index.c b/diff-no-index.c
index 1ae09894d7..df762fd0f7 100644
--- a/diff-no-index.c
+++ b/diff-no-index.c
@@ -185,8 +185,7 @@ static int queue_diff(struct diff_options *o,
struct diff_filespec *d1, *d2;
if (DIFF_OPT_TST(o, REVERSE_DIFF)) {
- unsigned tmp;
- tmp = mode1; mode1 = mode2; mode2 = tmp;
+ SWAP(mode1, mode2);
SWAP(name1, name2);
}
diff --git a/diff.c b/diff.c
index 9de1ba264f..6c4f3f6b72 100644
--- a/diff.c
+++ b/diff.c
@@ -5117,11 +5117,9 @@ void diff_change(struct diff_options *options,
return;
if (DIFF_OPT_TST(options, REVERSE_DIFF)) {
- unsigned tmp;
SWAP(old_mode, new_mode);
SWAP(old_sha1, new_sha1);
- tmp = old_sha1_valid; old_sha1_valid = new_sha1_valid;
- new_sha1_valid = tmp;
+ SWAP(old_sha1_valid, new_sha1_valid);
SWAP(old_dirty_submodule, new_dirty_submodule);
}