Skip to content
This repository was archived by the owner on Dec 28, 2024. It is now read-only.

Commit e6f26e5

Browse files
committed
Change all Matrix receiver functions to use pointers
1 parent 279ff7a commit e6f26e5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

common/util/matrix.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ func NewCharMatrix(
6060
return NewMatrixFromRows[uint8](rows)
6161
}
6262

63-
func (m Matrix[T]) IsInMatrix(
63+
func (m *Matrix[T]) IsInMatrix(
6464
x int,
6565
y int,
6666
) bool {
6767
invalid := x < 0 || y < 0 || x > m.MaxX || y > m.MaxY
6868
return !invalid
6969
}
7070

71-
func (m Matrix[T]) Get(
71+
func (m *Matrix[T]) Get(
7272
x int,
7373
y int,
7474
) (T, error) {
@@ -79,7 +79,7 @@ func (m Matrix[T]) Get(
7979
return m.RawMatrix[y][x], nil
8080
}
8181

82-
func (m Matrix[T]) GetOrDefault(
82+
func (m *Matrix[T]) GetOrDefault(
8383
x int,
8484
y int,
8585
defaultReturn T,
@@ -91,7 +91,7 @@ func (m Matrix[T]) GetOrDefault(
9191
return v, nil
9292
}
9393

94-
func (m Matrix[T]) Set(
94+
func (m *Matrix[T]) Set(
9595
x int,
9696
y int,
9797
value T,

0 commit comments

Comments
 (0)