From c6025daac4944303cb77fc56f94842fb4fbf7e25 Mon Sep 17 00:00:00 2001 From: Pavel Kalinnikov Date: Thu, 25 Jan 2024 15:13:21 +0000 Subject: [PATCH] remove unused min and max funcs Go has min/max built-ins since 1.21. https://tip.golang.org/doc/go1.21#language Signed-off-by: Pavel Kalinnikov --- tracker/progress.go | 14 -------------- util.go | 14 -------------- 2 files changed, 28 deletions(-) diff --git a/tracker/progress.go b/tracker/progress.go index 4002b1ec..b1a07fa0 100644 --- a/tracker/progress.go +++ b/tracker/progress.go @@ -106,20 +106,6 @@ func (pr *Progress) ResetState(state StateType) { pr.Inflights.reset() } -func max(a, b uint64) uint64 { - if a > b { - return a - } - return b -} - -func min(a, b uint64) uint64 { - if a > b { - return b - } - return a -} - // BecomeProbe transitions into StateProbe. Next is reset to Match+1 or, // optionally and if larger, the index of the pending snapshot. func (pr *Progress) BecomeProbe() { diff --git a/util.go b/util.go index 44dde5c5..c475a104 100644 --- a/util.go +++ b/util.go @@ -26,20 +26,6 @@ func (st StateType) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf("%q", st.String())), nil } -func min(a, b uint64) uint64 { - if a > b { - return b - } - return a -} - -func max(a, b uint64) uint64 { - if a > b { - return a - } - return b -} - var isLocalMsg = [...]bool{ pb.MsgHup: true, pb.MsgBeat: true,