Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for IsSortedFunc (0.31 sec)

  1. src/slices/sort_test.go

    	}
    	data := make(intPairs, n)
    
    	// random distribution
    	for i := 0; i < len(data); i++ {
    		data[i].a = rand.Intn(m)
    	}
    	if IsSortedFunc(data, intPairCmp) {
    		t.Fatalf("terrible rand.rand")
    	}
    	data.initB()
    	SortStableFunc(data, intPairCmp)
    	if !IsSortedFunc(data, intPairCmp) {
    		t.Errorf("Stable didn't sort %d ints", n)
    	}
    	if !data.inOrder(false) {
    		t.Errorf("Stable wasn't stable on %d ints", n)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 09 19:20:55 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  2. src/slices/iter_test.go

    	n, m := 1000, 100
    	data := make(intPairs, n)
    	for i := range data {
    		data[i].a = rand.IntN(m)
    	}
    	data.initB()
    
    	s := intPairs(SortedStableFunc(Values(data), intPairCmp))
    	if !IsSortedFunc(s, intPairCmp) {
    		t.Errorf("SortedStableFunc didn't sort %d ints", n)
    	}
    	if !s.inOrder(false) {
    		t.Errorf("SortedStableFunc wasn't stable on %d ints", n)
    	}
    
    	// iterVal converts a Seq2 to a Seq.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 17:28:50 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  3. src/internal/trace/batchcursor_test.go

    	l := len(heap)
    	var removed []*batchCursor
    	for i := 0; i < l; i++ {
    		removed = append(removed, heap[0])
    		heap = heapRemove(heap, 0)
    		checkHeap(t, heap)
    	}
    	if !slices.IsSortedFunc(removed, (*batchCursor).compare) {
    		t.Fatalf("heap elements not removed in sorted order, got: %s", heapDebugString(removed))
    	}
    }
    
    func makeBatchCursor(v int64) *batchCursor {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 3K bytes
    - Viewed (0)
  4. src/slices/example_test.go

    	fmt.Println(slices.IsSorted([]int{0, 2, 1}))
    	// Output:
    	// true
    	// false
    }
    
    func ExampleIsSortedFunc() {
    	names := []string{"alice", "Bob", "VERA"}
    	isSortedInsensitive := slices.IsSortedFunc(names, func(a, b string) int {
    		return strings.Compare(strings.ToLower(a), strings.ToLower(b))
    	})
    	fmt.Println(isSortedInsensitive)
    	fmt.Println(slices.IsSorted(names))
    	// Output:
    	// true
    	// false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 17:28:50 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  5. src/crypto/tls/tls_test.go

    				return +1
    			}
    			t.Fatalf("two ciphersuites are equal by all criteria: %v and %v", aName, bName)
    			panic("unreachable")
    		}
    		if !slices.IsSortedFunc(prefOrder, isBetter) {
    			t.Error("preference order is not sorted according to the rules")
    		}
    	}
    }
    
    func TestVersionName(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:10:12 UTC 2024
    - 60.5K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"Equal", Func, 21},
    		{"EqualFunc", Func, 21},
    		{"Grow", Func, 21},
    		{"Index", Func, 21},
    		{"IndexFunc", Func, 21},
    		{"Insert", Func, 21},
    		{"IsSorted", Func, 21},
    		{"IsSortedFunc", Func, 21},
    		{"Max", Func, 21},
    		{"MaxFunc", Func, 21},
    		{"Min", Func, 21},
    		{"MinFunc", Func, 21},
    		{"Replace", Func, 21},
    		{"Reverse", Func, 21},
    		{"Sort", Func, 21},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
Back to top