- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 487 for Slice3 (0.14 sec)
-
test/typeparam/slices.go
} // _Min returns the minimum element in a slice of some ordered type. // If the slice is empty it returns the zero value of the element type. func _SliceMin[Elem Ordered](s []Elem) Elem { if len(s) == 0 { var zero Elem return zero } return _Reduce(s[1:], s[0], _Min[Elem]) } // _Append adds values to the end of a slice, returning a new slice.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 01 19:45:34 UTC 2022 - 7.8K bytes - Viewed (0) -
src/runtime/slice.go
// // Do not remove or change the type signature. // See go.dev/issue/67401. // //go:linkname reflect_growslice reflect.growslice func reflect_growslice(et *_type, old slice, num int) slice { // Semantically equivalent to slices.Grow, except that the caller // is responsible for ensuring that old.len+num > old.cap. num -= old.cap - old.len // preserve memory of old[old.len:old.cap]
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 16:25:21 UTC 2024 - 12.2K bytes - Viewed (0) -
src/cmd/asm/internal/lex/slice.go
"cmd/internal/src" ) // A Slice reads from a slice of Tokens. type Slice struct { tokens []Token base *src.PosBase line int pos int } func NewSlice(base *src.PosBase, line int, tokens []Token) *Slice { return &Slice{ tokens: tokens, base: base, line: line, pos: -1, // Next will advance to zero. } } func (s *Slice) Next() ScanToken { s.pos++
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jun 29 22:49:50 UTC 2023 - 1.6K bytes - Viewed (0) -
src/go/parser/testdata/slices.go2
// Package slices implements various slice algorithms. package slices // Map turns a []T1 to a []T2 using a mapping function. func Map[T1, T2 any](s []T1, f func(T1) T2) []T2 { r := make([]T2, len(s)) for i, v := range s { r[i] = f(v) } return r } // Reduce reduces a []T1 to a single value using a reduction function. func Reduce[T1, T2 any](s []T1, initializer T2, f func(T2, T1) T2) T2 { r := initializer for _, v := range s {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Nov 24 19:44:06 UTC 2020 - 666 bytes - Viewed (0) -
src/sort/sort_test.go
} } // Compare Sort with slices.Sort sorting a float64 slice containing NaNs. func TestSortFloat64sCompareSlicesSort(t *testing.T) { slice1 := slices.Clone(float64s[:]) slice2 := slices.Clone(float64s[:]) Sort(Float64Slice(slice1)) slices.Sort(slice2) // Compare for equality using cmp.Compare, which considers NaNs equal.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 07 19:41:04 UTC 2024 - 16.9K bytes - Viewed (0) -
pilot/pkg/serviceregistry/serviceregistry_test.go
// Move the endpoint to another slice - transition phase where its duplicated createEndpointSlice(t, s.KubeClient().Kube(), "slice1", "service", namespace, []v1.EndpointPort{{Name: "http", Port: 80}}, []string{"1.2.3.5", "2.3.4.5"}) createEndpointSlice(t, s.KubeClient().Kube(), "slice2", "service", namespace, []v1.EndpointPort{{Name: "http", Port: 80}}, []string{"2.3.4.5"})
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Thu May 23 21:07:03 UTC 2024 - 51.2K bytes - Viewed (0) -
src/slices/slices.go
panic("needle not found") } // Reverse reverses the elements of the slice in place. func Reverse[S ~[]E, E any](s S) { for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 { s[i], s[j] = s[j], s[i] } } // Concat returns a new slice concatenating the passed in slices. func Concat[S ~[]E, E any](slices ...S) S { size := 0 for _, s := range slices { size += len(s) if size < 0 { panic("len out of range")
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Apr 29 14:01:59 UTC 2024 - 13.6K bytes - Viewed (0) -
pkg/util/slice/slice.go
See the License for the specific language governing permissions and limitations under the License. */ // Package slice provides utility methods for common operations on slices. package slice import ( "sort" ) // CopyStrings copies the contents of the specified string slice // into a new slice. func CopyStrings(s []string) []string { if s == nil { return nil } c := make([]string, len(s)) copy(c, s)
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Aug 21 19:03:53 UTC 2019 - 2.1K bytes - Viewed (0) -
src/go/types/slice.go
// Source: ../../cmd/compile/internal/types2/slice.go // Copyright 2011 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. package types // A Slice represents a slice type. type Slice struct { elem Type } // NewSlice returns a new slice type for the given element type. func NewSlice(elem Type) *Slice { return &Slice{elem: elem} }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Apr 03 18:48:38 UTC 2024 - 701 bytes - Viewed (0) -
src/cmd/compile/internal/types2/slice.go
package types2 // A Slice represents a slice type. type Slice struct { elem Type } // NewSlice returns a new slice type for the given element type. func NewSlice(elem Type) *Slice { return &Slice{elem: elem} } // Elem returns the element type of slice s. func (s *Slice) Elem() Type { return s.elem } func (s *Slice) Underlying() Type { return s }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jul 01 22:17:50 UTC 2021 - 577 bytes - Viewed (0)