X7ROOT File Manager
Current Path:
/opt/golang/1.22.0/src/sort
opt
/
golang
/
1.22.0
/
src
/
sort
/
📁
..
📄
example_interface_test.go
(1.47 KB)
📄
example_keys_test.go
(2.68 KB)
📄
example_multi_test.go
(4.05 KB)
📄
example_search_test.go
(2.12 KB)
📄
example_test.go
(2.85 KB)
📄
example_wrapper_test.go
(1.63 KB)
📄
export_test.go
(314 B)
📄
gen_sort_variants.go
(19.61 KB)
📄
search.go
(5.67 KB)
📄
search_test.go
(6.78 KB)
📄
slice.go
(1.81 KB)
📄
sort.go
(10.14 KB)
📄
sort_impl_120.go
(602 B)
📄
sort_impl_go121.go
(876 B)
📄
sort_slices_benchmark_test.go
(3.92 KB)
📄
sort_test.go
(16.91 KB)
📄
zsortfunc.go
(11.49 KB)
📄
zsortinterface.go
(11.22 KB)
Editing: sort_impl_go121.go
// Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build go1.21 // Starting with Go 1.21, we can leverage the new generic functions from the // slices package to implement some `sort` functions faster. However, until // the bootstrap compiler uses Go 1.21 or later, we keep a fallback version // in sort_impl_120.go that retains the old implementation. package sort import "slices" func intsImpl(x []int) { slices.Sort(x) } func float64sImpl(x []float64) { slices.Sort(x) } func stringsImpl(x []string) { slices.Sort(x) } func intsAreSortedImpl(x []int) bool { return slices.IsSorted(x) } func float64sAreSortedImpl(x []float64) bool { return slices.IsSorted(x) } func stringsAreSortedImpl(x []string) bool { return slices.IsSorted(x) }
Upload File
Create Folder