]> Cypherpunks.ru repositories - gostls13.git/commit
slices: clarify MinFunc/MaxFunc result for equal elements
authorIan Lance Taylor <iant@golang.org>
Fri, 23 Jun 2023 21:23:31 +0000 (14:23 -0700)
committerGopher Robot <gobot@golang.org>
Sat, 24 Jun 2023 00:50:42 +0000 (00:50 +0000)
commitea927e560d80f34dfaaeee14418e55cc80220485
tree1ce123d36b583c058fbb5ffebfdf87877bf6889c
parent3619255777ca544a08e1051ee641a1c1e2d0a903
slices: clarify MinFunc/MaxFunc result for equal elements

They should return the first of equal elements. No such clarification
is required for Min/Max as for them equal elements are indistinguishable.

For #60091

Change-Id: Iad58115d482add852c811e993131702b5b3bec5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/505796
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Eli Bendersky <eliben@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
src/slices/sort.go
src/slices/sort_test.go