use SWAP macro
[git/git.git] / diff.c
diff --git a/diff.c b/diff.c
index f08cd8e..9de1ba2 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -5118,13 +5118,11 @@ void diff_change(struct diff_options *options,
 
        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;
+               SWAP(old_mode, new_mode);
+               SWAP(old_sha1, new_sha1);
                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_dirty_submodule, new_dirty_submodule);
        }
 
        if (options->prefix &&