Staging
v0.8.1
https://github.com/git/git
Raw File
Tip revision: 898f80736c75878acc02dc55672317fcc0e0a5a6 authored by Junio C Hamano on 29 October 2020, 21:24:09 UTC
Git 2.29.2
Tip revision: 898f807
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