Staging
v0.8.1
https://github.com/git/git
Raw File
Tip revision: 8b1a5f33d3ed427b0a6eaee595537805db6bc38c authored by Johannes Schindelin on 12 February 2021, 14:49:17 UTC
Git 2.20.5
Tip revision: 8b1a5f3
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