Skip to content

Commit

Permalink
fix: Linter warnings in 2017 day 02
Browse files Browse the repository at this point in the history
  • Loading branch information
obalunenko committed Dec 16, 2024
1 parent 6a362c2 commit d46c963
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/puzzles/solutions/2017/day02/solution.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (s solution) Year() string {

func (s solution) Part1(input io.Reader) (string, error) {
var f checksumFunc = func(row []string) (int, error) {
var min, max int
var minVal, maxVal int

for i, number := range row {
d, err := strconv.Atoi(number)
Expand All @@ -37,19 +37,19 @@ func (s solution) Part1(input io.Reader) (string, error) {
}

if i == 0 {
min, max = d, d
minVal, maxVal = d, d
}

if d < min {
min = d
if d < minVal {
minVal = d
}

if d > max {
max = d
if d > maxVal {
maxVal = d
}
}

return max - min, nil
return maxVal - minVal, nil
}

return findChecksum(input, f)
Expand Down

0 comments on commit d46c963

Please sign in to comment.