corrade-vassal – Blame information for rev
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
13 | eva | 1 | /////////////////////////////////////////////////////////////////////////// |
2 | // Copyright (C) Wizardry and Steamworks 2013 - License: GNU GPLv3 // |
||
3 | // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // |
||
4 | // rights of fair usage, the disclaimer and warranty conditions. // |
||
5 | /////////////////////////////////////////////////////////////////////////// |
||
6 | |||
7 | namespace wasSharp |
||
8 | { |
||
9 | public class BitTwiddling |
||
10 | { |
||
11 | /////////////////////////////////////////////////////////////////////////// |
||
12 | // Copyright (C) 2014 Wizardry and Steamworks - License: GNU GPLv3 // |
||
13 | /////////////////////////////////////////////////////////////////////////// |
||
14 | /// <summary> |
||
15 | /// Swaps two integers passed by reference using XOR. |
||
16 | /// </summary> |
||
17 | /// <param name="q">first integer to swap</param> |
||
18 | /// <param name="p">second integer to swap</param> |
||
19 | public static void XORSwap(ref int q, ref int p) |
||
20 | { |
||
21 | q ^= p; |
||
22 | p ^= q; |
||
23 | q ^= p; |
||
24 | } |
||
25 | } |
||
26 | } |