Skip to content

Commit

Permalink
feat: Use Go min/max builtins
Browse files Browse the repository at this point in the history
The min and max builtins are available since Go 1.21. The
github.com/antlr4-go/antlr/v4 is specifying Go 1.22 in its go.mod file,
so the builtins can be used.

Signed-off-by: Tobias Klauser <[email protected]>
  • Loading branch information
tklauser committed May 21, 2024
1 parent 6197d6c commit 14a8984
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions runtime/Go/antlr/v4/tokenstream_rewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,22 +641,3 @@ func reduceToSingleOperationPerIndex(rewrites []RewriteOperation) map[int]Rewrit
}
return m
}

/*
Quick fixing Go lack of overloads
*/

func max(a, b int) int {
if a > b {
return a
} else {
return b
}
}
func min(a, b int) int {
if a < b {
return a
} else {
return b
}
}

0 comments on commit 14a8984

Please sign in to comment.