Minor solver refactoring

This commit is contained in:
Asriel Camora
2023-07-13 21:22:39 +02:00
parent df72386f19
commit 9a245aa9ad
3 changed files with 65 additions and 50 deletions
+7 -4
View File
@@ -55,10 +55,13 @@ public struct ActionSet
public readonly bool IsEmpty => bits == 0;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly ActionType SelectRandom(Random random) =>
IsDeterministic ?
First() :
ElementAt(random.Next(Count));
public readonly ActionType SelectRandom(Random random)
{
if (IsDeterministic)
return First();
return ElementAt(random.Next(Count));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ActionType PopRandom(Random random)