- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 246 for sortby (0.15 sec)
-
src/cmd/trace/goroutines.go
} // Sort. sortBy := r.FormValue("sortby") if _, ok := validNonOverlappingStats[sortBy]; ok { slices.SortFunc(goroutines, func(a, b goroutine) int { return cmp.Compare(b.NonOverlappingStats[sortBy], a.NonOverlappingStats[sortBy]) }) } else { // Sort by total time by default. slices.SortFunc(goroutines, func(a, b goroutine) int {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 17 18:48:18 UTC 2024 - 10.9K bytes - Viewed (0) -
src/cmd/trace/regions.go
maxTotal = r.TotalTime } } } // Sort. sortBy := r.FormValue("sortby") if _, ok := validNonOverlappingStats[sortBy]; ok { slices.SortFunc(regions, func(a, b region) int { return cmp.Compare(b.NonOverlappingStats[sortBy], a.NonOverlappingStats[sortBy]) }) } else { // Sort by total time by default. slices.SortFunc(regions, func(a, b region) int {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 17 18:48:18 UTC 2024 - 14.3K bytes - Viewed (0) -
pkg/slices/slices_test.go
b.StopTimer() ss := makeRandomStructs(N) b.StartTimer() SortStableFunc(ss, cmpFunc) } }) b.Run("SortBy", func(b *testing.B) { cmpFunc := func(a *myStruct) int { return a.n } for i := 0; i < b.N; i++ { b.StopTimer() ss := makeRandomStructs(N) b.StartTimer() SortBy(ss, cmpFunc) } }) } func ExampleSort() {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Fri May 10 23:33:56 UTC 2024 - 18.2K bytes - Viewed (0) -
pkg/slices/slices.go
if len(x) <= 1 { return x } slices.SortStableFunc(x, less) return x } // SortBy is a helper to sort a slice by some value. Typically, this would be sorting a struct // by a single field. If you need to have multiple fields, see the ExampleSort. func SortBy[E any, A constraints.Ordered](x []E, extract func(a E) A) []E { if len(x) <= 1 { return x } SortFunc(x, func(a, b E) int {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Wed May 15 06:28:11 UTC 2024 - 7.9K bytes - Viewed (0) -
analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/cases/components/scopeProvider/TestScopeRenderer.kt
withIndent { appendLine(it) } } } } } scope.getPackageSymbols() .toMutableList() .apply { sortBy { it.fqName.asString() } } .renderAll("packages") { prettyRenderPackage(it) } scope.getClassifierSymbols().toList().renderAll("classifiers") { prettyRenderDeclaration(it) }
Registered: Wed Jun 12 09:53:16 UTC 2024 - Last Modified: Tue Jun 04 08:26:19 UTC 2024 - 7.3K bytes - Viewed (0) -
pilot/pkg/config/kube/crdclient/client_test.go
go store.Run(stop) kube.WaitForCacheSync("test", stop, store.HasSynced) // The order of the events doesn't matter, so sort the two slices so the ordering is consistent sortFunc := func(a config.Config) string { return a.Key() } slices.SortBy(cfgsAdded, sortFunc) slices.SortBy(expected, sortFunc) assert.Equal(t, expected, cfgsAdded) } } func TestClientSync(t *testing.T) {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Fri May 10 02:58:52 UTC 2024 - 14.1K bytes - Viewed (0) -
istioctl/pkg/ztunnelconfig/ztunnelconfig.go
return types.NamespacedName{}, err } pods := slices.Reference(podsr.Items) if len(pods) > 0 { // We need to pass in a sorter, and the one used by `kubectl logs` is good enough. sortBy := func(pods []*corev1.Pod) sort.Interface { return podutils.ByLogging(pods) } sort.Sort(sortBy(pods)) return config.NamespacedName(pods[0]), nil } return types.NamespacedName{}, fmt.Errorf("no pods found") }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Thu Jun 06 20:18:34 UTC 2024 - 22K bytes - Viewed (0) -
pkg/kube/krt/collection_test.go
got := sets.New(strings.Split(s, ",")...) return want.Equals(got) } } func fetcherSorted[T krt.ResourceNamer](c krt.Collection[T]) func() []T { return func() []T { return slices.SortBy(c.List(), func(t T) string { return t.ResourceName() }) } } func TestCollectionMultipleFetch(t *testing.T) { type Result struct { Named Configs []string }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Sun Apr 28 04:22:19 UTC 2024 - 14.6K bytes - Viewed (0) -
pkg/kube/kclient/client_test.go
tracker.WaitOrdered("add/2") assert.Equal(t, tester.Get(obj2.Name, obj2.Namespace), obj2) // We should not see obj3, it is filtered deploys := tester.List(obj1.Namespace, klabels.Everything()) slices.SortBy(deploys, func(a *appsv1.Deployment) string { return a.Name }) assert.Equal(t, deploys, []*appsv1.Deployment{obj1, obj2}) assert.Equal(t, tester.Get(obj3.Name, obj3.Namespace), nil)
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Tue Jun 11 15:12:54 UTC 2024 - 17.2K bytes - Viewed (0) -
pilot/pkg/model/telemetry_logging.go
return cfg } func accessLogFormatters(text string, labels *structpb.Struct) []*core.TypedExtensionConfig { formatters := make([]*core.TypedExtensionConfig, 0, maxFormattersLength) defer func() { slices.SortBy(formatters, func(f *core.TypedExtensionConfig) string { return f.Name }) }() formatters = append(formatters, accessLogTextFormatters(text)...) if len(formatters) >= maxFormattersLength {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Fri Jun 14 04:34:30 UTC 2024 - 23K bytes - Viewed (0)