Staging
v0.8.1
https://github.com/git/git
Raw File
Tip revision: cf8899d285d2648013040ec7196ffd3de0606664 authored by Junio C Hamano on 01 August 2017, 18:45:17 UTC
Git 2.13.4
Tip revision: cf8899d
swap.cocci
@ 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
  }
back to top