Performance tweaks
This commit is contained in:
1 file changed
+12
-3
@@ -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];
|
||||
|
||||
Reference in new issue
Block a user