- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 415 for SWAP (0.13 sec)
-
src/sort/example_wrapper_test.go
type Organ struct { Name string Weight Grams } type Organs []*Organ func (s Organs) Len() int { return len(s) } func (s Organs) Swap(i, j int) { s[i], s[j] = s[j], s[i] } // ByName implements sort.Interface by providing Less and using the Len and // Swap methods of the embedded Organs value. type ByName struct{ Organs } func (s ByName) Less(i, j int) bool { return s.Organs[i].Name < s.Organs[j].Name }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Sep 08 04:08:51 UTC 2014 - 1.6K bytes - Viewed (0) -
pkg/kubelet/util/swap/swap_util_test.go
limitations under the License. */ package swap import "testing" func TestIsSwapEnabled(t *testing.T) { testCases := []struct { name string procSwapsContent string expectedEnabled bool }{ { name: "empty", procSwapsContent: "", expectedEnabled: false, }, { name: "with swap enabled, one partition", procSwapsContent: `
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue May 21 10:18:16 UTC 2024 - 1.6K bytes - Viewed (0) -
src/sync/atomic/value_test.go
}{ {init: nil, new: nil, old: nil, err: "sync/atomic: compare and swap of nil value into Value"}, {init: nil, new: true, old: "", err: "sync/atomic: compare and swap of inconsistently typed values into Value"}, {init: nil, new: true, old: true, want: false, err: nil}, {init: nil, new: true, old: nil, want: true, err: nil}, {init: true, new: "", err: "sync/atomic: compare and swap of inconsistently typed value into Value"},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 13 18:45:54 UTC 2021 - 6.1K bytes - Viewed (0) -
subprojects/core/src/testFixtures/groovy/org/gradle/util/BinaryDiffUtils.groovy
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Fri Oct 14 11:47:34 UTC 2016 - 2.4K bytes - Viewed (0) -
pkg/kubelet/stats/cri_stats_provider.go
} if stats.Swap != nil { result.Swap.Time = metav1.NewTime(time.Unix(0, stats.Swap.Timestamp)) if stats.Swap.SwapUsageBytes != nil { result.Swap.SwapUsageBytes = &stats.Swap.SwapUsageBytes.Value } if stats.Swap.SwapAvailableBytes != nil { result.Swap.SwapAvailableBytes = &stats.Swap.SwapAvailableBytes.Value } } else {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Nov 01 18:46:33 UTC 2023 - 35.1K bytes - Viewed (0) -
pkg/kubelet/util/sliceutils/sliceutils_test.go
} for _, fooTest := range fooTests { fooi := fooTest.pods[fooTest.i] fooj := fooTest.pods[fooTest.j] fooTest.pods.Swap(fooTest.i, fooTest.j) if fooi.GetName() != fooTest.pods[fooTest.j].GetName() || fooj.GetName() != fooTest.pods[fooTest.i].GetName() { t.Errorf("failed to swap for %v", fooTest) } } } func TestPodsByCreationTimeLess(t *testing.T) { fooTests := []struct { pods PodsByCreationTime
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri Jan 13 08:27:42 UTC 2023 - 4.7K bytes - Viewed (0) -
src/go/parser/testdata/sort.go2
package sort type orderedSlice[Elem comparable] []Elem func (s orderedSlice[Elem]) Len() int { return len(s) } func (s orderedSlice[Elem]) Less(i, j int) bool { return s[i] < s[j] } func (s orderedSlice[Elem]) Swap(i, j int) { s[i], s[j] = s[j], s[i] } // OrderedSlice sorts the slice s in ascending order. // The elements of s must be ordered using the < operator. func OrderedSlice[Elem comparable](s []Elem) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Nov 24 19:44:06 UTC 2020 - 902 bytes - Viewed (0) -
src/sync/atomic/atomic_test.go
func() { SwapInt32(nil, 0) }, func() { (*Int32)(nil).Swap(0) }, func() { SwapUint32(nil, 0) }, func() { (*Uint32)(nil).Swap(0) }, func() { SwapInt64(nil, 0) }, func() { (*Int64)(nil).Swap(0) }, func() { SwapUint64(nil, 0) }, func() { (*Uint64)(nil).Swap(0) }, func() { SwapUintptr(nil, 0) }, func() { (*Uintptr)(nil).Swap(0) }, func() { SwapPointer(nil, nil) },
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 17 18:37:29 UTC 2024 - 71.4K bytes - Viewed (0) -
src/cmd/compile/internal/types/sort.go
func (x MethodsByName) Len() int { return len(x) } func (x MethodsByName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } func (x MethodsByName) Less(i, j int) bool { return x[i].Sym.Less(x[j].Sym) } // EmbeddedsByName sorts embedded types by name. type EmbeddedsByName []*Field func (x EmbeddedsByName) Len() int { return len(x) } func (x EmbeddedsByName) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 27 22:13:38 UTC 2021 - 765 bytes - Viewed (0) -
src/container/heap/heap.go
// Pop is equivalent to [Remove](h, 0). func Pop(h Interface) any { n := h.Len() - 1 h.Swap(0, n) down(h, 0, n) return h.Pop() } // Remove removes and returns the element at index i from the heap. // The complexity is O(log n) where n = h.Len(). func Remove(h Interface, i int) any { n := h.Len() - 1 if n != i { h.Swap(i, n) if !down(h, i, n) { up(h, i) } } return h.Pop() }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 12 14:39:10 UTC 2023 - 3.3K bytes - Viewed (0)