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
This commit is contained in:
Junio C Hamano
2017-02-15 12:54:19 -08:00
14 changed files with 63 additions and 65 deletions

View File

@ -0,0 +1,28 @@
@ swap_with_declaration @
type T;
identifier tmp;
T a, b;
@@
- T tmp = a;
+ T tmp;
+ tmp = a;
a = b;
b = tmp;
@ swap @
type T;
T tmp, a, b;
@@
- tmp = a;
- a = b;
- b = tmp;
+ SWAP(a, b);
@ extends swap @
identifier unused;
@@
{
...
- T unused;
... when != unused
}