1
0
mirror of https://github.com/golang/go synced 2024-11-06 13:36:12 -07:00
go/src/sort
张云浩 415e3fd8a6 slices: use !{{Less}} instead of {{GreaterOrEqual}}
In CL 371574 PatchSet 18, we replaced all !{{Less}} with {{GreaterOrEqual}} to fix a problem(handle NaNs when sorting float64 slice) in exp/slices.

We don't actually need this change, because we don't guarantee that the slice will be sorted eventually if there are NaNs(we could have a[i] < a[j] for some i,j with i>j).

This CL reverts all the replacements in exp/slices and does not affect any codes in the sort package.

Change-Id: Idc225d480de3e2efef2add35c709ed880d1306cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/400534
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Eli Bendersky <eliben@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@google.com>
2022-04-25 19:12:14 +00:00
..
example_interface_test.go
example_keys_test.go
example_multi_test.go sort: use pdqsort 2022-04-13 20:16:24 +00:00
example_search_test.go
example_test.go
example_wrapper_test.go
export_test.go sort: use pdqsort 2022-04-13 20:16:24 +00:00
gen_sort_variants.go slices: use !{{Less}} instead of {{GreaterOrEqual}} 2022-04-25 19:12:14 +00:00
search_test.go sort: add Find function 2022-04-07 14:42:13 +00:00
search.go sort: add Find function 2022-04-07 14:42:13 +00:00
slice_go14.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
slice_go18.go
slice_go113.go
slice.go sort: use pdqsort 2022-04-13 20:16:24 +00:00
sort_test.go sort: use pdqsort 2022-04-13 20:16:24 +00:00
sort.go sort: use pdqsort 2022-04-13 20:16:24 +00:00
zsortfunc.go sort: use pdqsort 2022-04-13 20:16:24 +00:00
zsortinterface.go sort: use pdqsort 2022-04-13 20:16:24 +00:00