use a template for indexing Board

This commit is contained in:
Joseph Montanaro 2021-03-25 18:00:39 -07:00
parent 239e99c79f
commit afacd2b52b

View File

@ -50,7 +50,8 @@ type
initialized: bool
proc `[]`*[T](b: var Board, idx: T): var Square =
# use a template here for better inlining
template `[]`*[T](b: var Board, idx: T): var Square =
b.squares[idx]