mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 05:35:41 +00:00
Swap via deconstruction
This commit is contained in:
parent
a73ec546d1
commit
a8087771c8
@ -53,9 +53,7 @@ namespace X10D
|
|||||||
while (count > 0)
|
while (count > 0)
|
||||||
{
|
{
|
||||||
int index = random.Next(count--);
|
int index = random.Next(count--);
|
||||||
var temp = source[count];
|
(source[count], source[index]) = (source[index], source[count]);
|
||||||
source[count] = source[index];
|
|
||||||
source[index] = temp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user