Performance tweaks

This commit is contained in:
Deukhoofd committed 2026-11-17 21:48:13 +01:00
1 parent 6df8cd800e
commit b564d5cc67
1 file changed
+12 -3
+12 -3
View File
@@ -545,9 +545,18 @@ public class AtomorphThread : IDisposable
for (ulong i = 0; i < repeat; ++i)
{
ulong x1 = random.GenerateNext((uint)(width - 1));
ulong x2 = random.GenerateNext((uint)(width - 2));
if (x2 >= x1)
x2++;
uint x2;
if (width == 2)
{
x2 = (x1 == 0 ? 1u : 0u); // Only two columns, swap them.
}
else
{
x2 = random.GenerateNext((uint)(width - 2));
if (x2 >= x1)
x2++;
}
var x1Row = map[x1];
var x2Row = map[x2];