interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / tools / coccinelle / swap.cocci

28 lines · 257 bytes Raw Blame History
1@@
2type T;
3identifier tmp;
4T a, b;
5@@
6- T tmp = a;
7+ T tmp;
8+ tmp = a;
9 a = b;
10 b = tmp;
11
12@ swap @
13type T;
14T tmp, a, b;
15@@
16- tmp = a;
17- a = b;
18- b = tmp;
19+ SWAP(a, b);
20
21@ extends swap @
22identifier unused;
23@@
24 {
25 ...
26- T unused;
27 ... when != unused
28 }