From 5d979f21b6326165f0c930f91ae1834645679355 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 21 May 2024 17:34:42 +0200 Subject: [PATCH] feat: Use Go min/max builtins The min and max builtins are available since Go 1.21[^1]. The github.com/antlr4-go/antlr/v4 is specifying Go 1.22 in its go.mod file, so the builtins can be used. [^1]: https://go.dev/doc/go1.21#language Signed-off-by: Tobias Klauser --- runtime/Go/antlr/v4/tokenstream_rewriter.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/runtime/Go/antlr/v4/tokenstream_rewriter.go b/runtime/Go/antlr/v4/tokenstream_rewriter.go index ccf59b465c..e3b3104592 100644 --- a/runtime/Go/antlr/v4/tokenstream_rewriter.go +++ b/runtime/Go/antlr/v4/tokenstream_rewriter.go @@ -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 - } -}