]> Cypherpunks repositories - gostls13.git/commit
slices: use !{{Less}} instead of {{GreaterOrEqual}}
author张云浩 <zhangyunhao@bytedance.com>
Fri, 15 Apr 2022 07:45:17 +0000 (07:45 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 25 Apr 2022 19:12:14 +0000 (19:12 +0000)
commit415e3fd8a6e62d7e9cf7d0c995518179dc0b7723
tree6c059f35d505f5d3852feb63ec4e8f57451be92e
parent60178e6240d6d0e52ca0556fcab29a1d3effef4d
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>
src/sort/gen_sort_variants.go