Swap via deconstruction

This commit is contained in:
Oliver Booth 2022-02-14 15:45:52 +00:00
parent a73ec546d1
commit a8087771c8
1 changed files with 1 additions and 3 deletions

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]);
}
}
}