1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-10 05:15:43 +00:00

Swap via deconstruction

This commit is contained in:
Oliver Booth 2022-02-14 15:45:52 +00:00
parent a73ec546d1
commit a8087771c8

View File

@ -53,9 +53,7 @@ namespace X10D
while (count > 0)
{
int index = random.Next(count--);
var temp = source[count];
source[count] = source[index];
source[index] = temp;
(source[count], source[index]) = (source[index], source[count]);
}
}
}