summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-02-15 20:54:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-02-15 20:54:19 (GMT)
commitcbf1860d73b782e7924e63361df485b31225a26a (patch)
treea86ce71a399fb8153be1552f08e51c58b2c5b5cf /diff.c
parent2f4e87d7777a0bcffa8a7cc3cc52e1e8b2c352ff (diff)
parent9e2edd66dda418dad751d5eb2e5921e05e57cd30 (diff)
downloadgit-cbf1860d73b782e7924e63361df485b31225a26a.zip
git-cbf1860d73b782e7924e63361df485b31225a26a.tar.gz
git-cbf1860d73b782e7924e63361df485b31225a26a.tar.bz2
Merge branch 'rs/swap'
Code clean-up. * rs/swap: graph: use SWAP macro diff: use SWAP macro use SWAP macro apply: use SWAP macro add SWAP macro
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/diff.c b/diff.c
index a79f340..051761b 100644
--- a/diff.c
+++ b/diff.c
@@ -5118,14 +5118,10 @@ void diff_change(struct diff_options *options,
return;
if (DIFF_OPT_TST(options, REVERSE_DIFF)) {
- unsigned tmp;
- const unsigned char *tmp_c;
- tmp = old_mode; old_mode = new_mode; new_mode = tmp;
- tmp_c = old_sha1; old_sha1 = new_sha1; new_sha1 = tmp_c;
- tmp = old_sha1_valid; old_sha1_valid = new_sha1_valid;
- new_sha1_valid = tmp;
- tmp = old_dirty_submodule; old_dirty_submodule = new_dirty_submodule;
- new_dirty_submodule = tmp;
+ SWAP(old_mode, new_mode);
+ SWAP(old_sha1, new_sha1);
+ SWAP(old_sha1_valid, new_sha1_valid);
+ SWAP(old_dirty_submodule, new_dirty_submodule);
}
if (options->prefix &&