Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 38 for SubsetOf (0.18 sec)

  1. src/go/types/termlist.go

    // supersetOf reports whether y ⊆ xl.
    func (xl termlist) supersetOf(y *term) bool {
    	for _, x := range xl {
    		if y.subsetOf(x) {
    			return true
    		}
    	}
    	return false
    }
    
    // subsetOf reports whether xl ⊆ yl.
    func (xl termlist) subsetOf(yl termlist) bool {
    	if yl.isEmpty() {
    		return xl.isEmpty()
    	}
    
    	// each term x of xl must be a subset of yl
    	for _, x := range xl {
    		if !yl.supersetOf(x) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/termlist.go

    // supersetOf reports whether y ⊆ xl.
    func (xl termlist) supersetOf(y *term) bool {
    	for _, x := range xl {
    		if y.subsetOf(x) {
    			return true
    		}
    	}
    	return false
    }
    
    // subsetOf reports whether xl ⊆ yl.
    func (xl termlist) subsetOf(yl termlist) bool {
    	if yl.isEmpty() {
    		return xl.isEmpty()
    	}
    
    	// each term x of xl must be a subset of yl
    	for _, x := range xl {
    		if !yl.supersetOf(x) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Sep 03 18:29:30 UTC 2022
    - 3.8K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/internal/typeparams/termlist.go

    // supersetOf reports whether y ⊆ xl.
    func (xl termlist) supersetOf(y *term) bool {
    	for _, x := range xl {
    		if y.subsetOf(x) {
    			return true
    		}
    	}
    	return false
    }
    
    // subsetOf reports whether xl ⊆ yl.
    func (xl termlist) subsetOf(yl termlist) bool {
    	if yl.isEmpty() {
    		return xl.isEmpty()
    	}
    
    	// each term x of xl must be a subset of yl
    	for _, x := range xl {
    		if !yl.supersetOf(x) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 21 21:08:44 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  4. pkg/config/labels/instance_test.go

    			right:    labels.Instance{"foo": ""},
    			expected: result{false, false},
    		},
    	}
    	for _, c := range cases {
    		var got result
    		got.subsetOf = c.left.SubsetOf(c.right)
    		got.selected = c.left.Match(c.right)
    		if got != c.expected {
    			t.Errorf("%v.SubsetOf(%v) got %v, expected %v", c.left, c.right, got, c.expected)
    		}
    	}
    }
    
    func TestString(t *testing.T) {
    	cases := []struct {
    		input    labels.Instance
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Jun 16 06:54:36 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  5. pkg/config/labels/instance.go

    // could have labels gitCommit=aeiou234, region=us-east, while v2 instances could
    // have labels name=kittyCat,region=us-east.
    type Instance map[string]string
    
    // SubsetOf is true if the label has same values for the keys
    func (i Instance) SubsetOf(that Instance) bool {
    	if len(i) == 0 {
    		return true
    	}
    
    	if len(that) == 0 || len(that) < len(i) {
    		return false
    	}
    
    	for k, v1 := range i {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Jun 16 06:54:36 UTC 2023
    - 5K bytes
    - Viewed (0)
  6. pkg/config/host/name.go

    	}
    
    	// both are non-wildcards, so do normal string comparison
    	return n == o
    }
    
    // SubsetOf returns true if this hostname is a valid subset of the other hostname. The semantics are
    // the same as "Matches", but only in one direction (i.e., n is covered by o).
    func (n Name) SubsetOf(o Name) bool {
    	hWildcard := n.IsWildCarded()
    	oWildcard := o.IsWildCarded()
    
    	if hWildcard {
    		if oWildcard {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jan 09 16:25:50 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/termlist_test.go

    		{"int | ~string", "string | int | ∅ | string", false},
    		{"int | myInt", "string | ~int | ∅ | string", true},
    	} {
    		xl := maketl(test.xl)
    		yl := maketl(test.yl)
    		got := xl.subsetOf(yl)
    		if got != test.want {
    			t.Errorf("(%v).subsetOf(%v) = %v; want %v", test.xl, test.yl, got, test.want)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 07 21:37:14 UTC 2022
    - 7.2K bytes
    - Viewed (0)
  8. pkg/config/host/names.go

    func (h Names) Intersection(other Names) Names {
    	result := make(Names, 0, len(h))
    	for _, hHost := range h {
    		for _, oHost := range other {
    			if hHost.SubsetOf(oHost) {
    				if !result.Contains(hHost) {
    					result = append(result, hHost)
    				}
    			} else if oHost.SubsetOf(hHost) {
    				if !result.Contains(oHost) {
    					result = append(result, oHost)
    				}
    			}
    		}
    	}
    	return result
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Nov 01 19:19:22 UTC 2022
    - 4.3K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/typeterm.go

    	case x.typ == nil:
    		return true // t ∈ 𝓤 == true
    	}
    	// ∅ ⊂ x ⊂ 𝓤
    
    	u := t
    	if x.tilde {
    		u = under(u)
    	}
    	return Identical(x.typ, u)
    }
    
    // subsetOf reports whether x ⊆ y.
    func (x *term) subsetOf(y *term) bool {
    	// easy cases
    	switch {
    	case x == nil:
    		return true // ∅ ⊆ y == true
    	case y == nil:
    		return false // x ⊆ ∅ == false since x != ∅
    	case y.typ == nil:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 3.5K bytes
    - Viewed (0)
  10. src/go/types/typeterm.go

    	case x.typ == nil:
    		return true // t ∈ 𝓤 == true
    	}
    	// ∅ ⊂ x ⊂ 𝓤
    
    	u := t
    	if x.tilde {
    		u = under(u)
    	}
    	return Identical(x.typ, u)
    }
    
    // subsetOf reports whether x ⊆ y.
    func (x *term) subsetOf(y *term) bool {
    	// easy cases
    	switch {
    	case x == nil:
    		return true // ∅ ⊆ y == true
    	case y == nil:
    		return false // x ⊆ ∅ == false since x != ∅
    	case y.typ == nil:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 3.6K bytes
    - Viewed (0)
Back to top