]> Cypherpunks repositories - gostls13.git/commitdiff
slices: add godoc links
authorTobias Klauser <tklauser@distanz.ch>
Mon, 26 Jun 2023 08:56:55 +0000 (10:56 +0200)
committerGopher Robot <gobot@golang.org>
Mon, 26 Jun 2023 19:11:18 +0000 (19:11 +0000)
Change-Id: I79d2bab2275f123636b63e87533ae9dad69ee00f
Reviewed-on: https://go-review.googlesource.com/c/go/+/506135
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/slices/slices.go
src/slices/sort.go

index c8eacae90e541107afb69ad073e404391b8b9d49..653d4dd093cdffd96fa1e9bdbdbb51536d64a539 100644 (file)
@@ -68,7 +68,7 @@ func Compare[S ~[]E, E cmp.Ordered](s1, s2 S) int {
        return 0
 }
 
-// CompareFunc is like Compare but uses a custom comparison function on each
+// CompareFunc is like [Compare] but uses a custom comparison function on each
 // pair of elements.
 // The result is the first non-zero result of cmp; if cmp always
 // returns 0 the result is 0 if len(s1) == len(s2), -1 if len(s1) < len(s2),
@@ -368,7 +368,7 @@ func Compact[S ~[]E, E comparable](s S) S {
        return s[:i]
 }
 
-// CompactFunc is like Compact but uses a comparison function.
+// CompactFunc is like [Compact] but uses a comparison function.
 func CompactFunc[S ~[]E, E any](s S, eq func(E, E) bool) S {
        if len(s) < 2 {
                return s
index af1d51ecd4653c4a85f8b4189560b5739639a33b..a634c12f6fcbd280336a6b3391dc37ffdbd7dc70 100644 (file)
@@ -138,7 +138,7 @@ func BinarySearch[S ~[]E, E cmp.Ordered](x S, target E) (int, bool) {
        return i, i < n && (x[i] == target || (isNaN(x[i]) && isNaN(target)))
 }
 
-// BinarySearchFunc works like BinarySearch, but uses a custom comparison
+// BinarySearchFunc works like [BinarySearch], but uses a custom comparison
 // function. The slice must be sorted in increasing order, where "increasing"
 // is defined by cmp. cmp should return 0 if the slice element matches
 // the target, a negative number if the slice element precedes the target,