Skip to content

Commit

Permalink
🧹 Replace Unsafe.As<bool, byte> with (isWhite ? 1 : 0) (#1155)
Browse files Browse the repository at this point in the history
  • Loading branch information
eduherminio authored Nov 12, 2024
1 parent ecb1c90 commit f20fd48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Lynx/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static int PieceOffset(int side)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int PieceOffset(bool isWhite)
{
return 6 - (6 * Unsafe.As<bool, byte>(ref isWhite));
return 6 - (6 * (isWhite ? 1 : 0));
}

/// <summary>
Expand Down

0 comments on commit f20fd48

Please sign in to comment.