Skip to content

Commit

Permalink
refactor: Use built in min() & max() on 1.21+ (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
bodgit committed Feb 7, 2024
1 parent 92d26c8 commit 9e0ded8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
16 changes: 0 additions & 16 deletions internal/bra/bra.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,3 @@ type converter interface {
Size() int
Convert([]byte, bool) int
}

func max(x, y int) int {
if x > y {
return x
}

return y
}

func min(x, y int) int {
if x < y {
return x
}

return y
}
19 changes: 19 additions & 0 deletions internal/bra/minmax_compat.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//go:build !1.21

package bra

func min(x, y int) int {
if x < y {
return x
}

return y
}

func max(x, y int) int {
if x > y {
return x
}

return y
}

0 comments on commit 9e0ded8

Please sign in to comment.