Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/tools/coccinelle/swap.cocci # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / tools / coccinelle / swap.cocci` 28 lines ยท 257 bytes Raw Blame History 1 @@ 2 type T; 3 identifier tmp; 4 T a, b; 5 @@ 6 - T tmp = a; 7 + T tmp; 8 + tmp = a; 9 a = b; 10 b = tmp; 11 12 @ swap @ 13 type T; 14 T tmp, a, b; 15 @@ 16 - tmp = a; 17 - a = b; 18 - b = tmp; 19 + SWAP(a, b); 20 21 @ extends swap @ 22 identifier unused; 23 @@ 24 { 25 ... 26 - T unused; 27 ... when != unused 28 }