Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for compareInt (0.7 sec)

  1. test/typeparam/issue51423.dir/b.go

    package b
    
    import "./a"
    
    func C() a.Comparator[int] {
    	return a.CompareInt[int]
    }
    
    func main() {
    	_ = C()(1, 2)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 11 00:42:08 UTC 2022
    - 114 bytes
    - Viewed (0)
  2. test/typeparam/issue51423.dir/a.go

    // Copyright 2022 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 a
    
    type Comparator[T any] func(v1, v2 T) int
    
    func CompareInt[T ~int](a, b T) int {
    	if a < b {
    		return -1
    	}
    	if a == b {
    		return 0
    	}
    	return 1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 11 00:42:08 UTC 2022
    - 318 bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/mod/semver/semver.go

    	pw, ok2 := parse(w)
    	if !ok1 && !ok2 {
    		return 0
    	}
    	if !ok1 {
    		return -1
    	}
    	if !ok2 {
    		return +1
    	}
    	if c := compareInt(pv.major, pw.major); c != 0 {
    		return c
    	}
    	if c := compareInt(pv.minor, pw.minor); c != 0 {
    		return c
    	}
    	if c := compareInt(pv.patch, pw.patch); c != 0 {
    		return c
    	}
    	return comparePrerelease(pv.prerelease, pw.prerelease)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jul 12 20:38:21 UTC 2023
    - 8.9K bytes
    - Viewed (0)
  4. src/cmd/vendor/golang.org/x/tools/internal/versions/gover.go

    		return "", "", false
    	}
    	return x[:i], x[i:], true
    }
    
    // cmpInt returns cmp.Compare(x, y) interpreting x and y as decimal numbers.
    // (Copied from golang.org/x/mod/semver's compareInt.)
    func cmpInt(x, y string) int {
    	if x == y {
    		return 0
    	}
    	if len(x) < len(y) {
    		return -1
    	}
    	if len(x) > len(y) {
    		return +1
    	}
    	if x < y {
    		return -1
    	} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 20 21:52:54 UTC 2023
    - 4.2K bytes
    - Viewed (0)
  5. src/internal/gover/gover.go

    		return "", "", false
    	}
    	return x[:i], x[i:], true
    }
    
    // CmpInt returns cmp.Compare(x, y) interpreting x and y as decimal numbers.
    // (Copied from golang.org/x/mod/semver's compareInt.)
    func CmpInt(x, y string) int {
    	if x == y {
    		return 0
    	}
    	if len(x) < len(y) {
    		return -1
    	}
    	if len(x) > len(y) {
    		return +1
    	}
    	if x < y {
    		return -1
    	} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 06 23:20:32 UTC 2023
    - 5.8K bytes
    - Viewed (0)
  6. platforms/software/dependency-management/src/main/java/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/PomParent.java

    import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.data.MavenDependencyKey;
    import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.data.PomDependencyMgt;
    
    import java.util.Map;
    
    public interface PomParent {
        /**
         * Gets POM, GAV and custom properties.
         *
         * @return Properties
         */
        Map<String, String> getProperties();
    
        /**
         * Gets declared dependencies.
         *
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  7. pkg/scheduler/internal/heap/heap_test.go

    	return testHeapObject{name: name, val: val}
    }
    
    func compareInts(val1 interface{}, val2 interface{}) bool {
    	first := val1.(testHeapObject).val.(int)
    	second := val2.(testHeapObject).val.(int)
    	return first < second
    }
    
    // TestHeapBasic tests Heap invariant
    func TestHeapBasic(t *testing.T) {
    	h := New(testHeapObjectKeyFunc, compareInts)
    	const amount = 500
    	var i int
    
    	// empty queue
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Sep 05 02:24:38 UTC 2023
    - 7.9K bytes
    - Viewed (0)
  8. platforms/software/dependency-management/src/main/java/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/RootPomParent.java

    import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.data.PomDependencyMgt;
    
    import java.util.Collections;
    import java.util.Map;
    
    public class RootPomParent implements PomParent {
        private final Map<String, String> properties = Collections.emptyMap();
        private final Map<MavenDependencyKey, PomReader.PomDependencyData> dependencies = Collections.emptyMap();
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 1.8K bytes
    - Viewed (0)
Back to top