From f0b3b088a2f69523533ee0c2160f3382e46d39fb Mon Sep 17 00:00:00 2001 From: Alex Gartner Date: Tue, 8 Oct 2024 08:48:12 -0700 Subject: [PATCH] update slices.SortFunc usage --- zetaclient/context/chain.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zetaclient/context/chain.go b/zetaclient/context/chain.go index 117b921168..d4e7e526b7 100644 --- a/zetaclient/context/chain.go +++ b/zetaclient/context/chain.go @@ -1,6 +1,7 @@ package context import ( + "cmp" "fmt" "sync" @@ -65,7 +66,9 @@ func (cr *ChainRegistry) Get(chainID int64) (Chain, error) { func (cr *ChainRegistry) All() []Chain { items := maps.Values(cr.chains) - slices.SortFunc(items, func(a, b Chain) bool { return a.ID() < b.ID() }) + slices.SortFunc(items, func(a, b Chain) int { + return cmp.Compare(a.ID(), b.ID()) + }) return items }