Skip to content

Commit

Permalink
Make Square.unsafe private
Browse files Browse the repository at this point in the history
  • Loading branch information
lenguyenthanh committed Oct 25, 2024
1 parent 62f6f7a commit bfab101
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/scala/Square.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ object Square:

inline def apply(inline file: File, inline rank: Rank): Square = file.value + 8 * rank.value

inline def apply(index: Int): Option[Square] = Option.when(0 <= index && index < 64)(index)
def unsafe(index: Int): Square = index
inline def apply(index: Int): Option[Square] = Option.when(0 <= index && index < 64)(index)
private[chess] def unsafe(index: Int): Square = index

inline def at(x: Int, y: Int): Option[Square] = Option.when(0 <= x && x < 8 && 0 <= y && y < 8)(x + 8 * y)

Expand Down

0 comments on commit bfab101

Please sign in to comment.