From 054d372470d1873cdbb54be3b73842634b9fc11f Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 13 Dec 2024 19:29:32 +0000 Subject: [PATCH] mv --- day-13/internal/util/util.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/day-13/internal/util/util.go b/day-13/internal/util/util.go index f27261c..08b3fe4 100644 --- a/day-13/internal/util/util.go +++ b/day-13/internal/util/util.go @@ -35,15 +35,15 @@ func ParseLines(r io.Reader) ([]*machine.Machine, error) { matches = append(matches, m) } + if err := scanner.Err(); err != nil { + return nil, err + } + var machines []*machine.Machine for i := 0; i < len(matches); i += 3 { machines = append(machines, machine.New(matches[i], matches[i+1], matches[i+2])) } - if err := scanner.Err(); err != nil { - return nil, err - } - return machines, nil }