Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for SupersetOf (0.14 sec)

  1. pkg/util/sets/set.go

    	for key := range s {
    		if !s2.Contains(key) {
    			delete(s, key)
    		}
    	}
    	return s
    }
    
    // SupersetOf returns true if s contains all elements of s2
    // For example:
    // s = {a1, a2, a3}
    // s2 = {a1, a2, a3, a4, a5}
    // s.SupersetOf(s2) = false
    // s2.SupersetOf(s) = true
    func (s Set[T]) SupersetOf(s2 Set[T]) bool {
    	if s2 == nil {
    		return true
    	}
    	if len(s2) > len(s) {
    		return false
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sat Mar 30 05:26:03 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/termlist.go

    // includes reports whether t ∈ xl.
    func (xl termlist) includes(t Type) bool {
    	for _, x := range xl {
    		if x.includes(t) {
    			return true
    		}
    	}
    	return false
    }
    
    // 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.
    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

    func (xl termlist) includes(t types.Type) bool {
    	for _, x := range xl {
    		if x.includes(t) {
    			return true
    		}
    	}
    	return false
    }
    
    // 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.
    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. src/go/types/termlist.go

    // includes reports whether t ∈ xl.
    func (xl termlist) includes(t Type) bool {
    	for _, x := range xl {
    		if x.includes(t) {
    			return true
    		}
    	}
    	return false
    }
    
    // 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.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  5. pkg/util/sets/set_test.go

    	}
    	set2 := New[string]()
    	for i := 0; i < 50; i++ {
    		set2.Insert(fmt.Sprint(i))
    	}
    	b.ResetTimer()
    
    	b.Run("SupersetOf", func(b *testing.B) {
    		for n := 0; n < b.N; n++ {
    			set1.SupersetOf(set2)
    		}
    	})
    }
    
    func TestEquals(t *testing.T) {
    	tests := []struct {
    		name   string
    		first  Set[string]
    		second Set[string]
    		want   bool
    	}{
    		{
    			"both nil",
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sat Mar 30 05:26:03 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  6. src/go/types/termlist_test.go

    		{"~int | string | ∅", "string", true},
    		{"~string | ∅ | 𝓤", "myInt", true},
    	} {
    		xl := maketl(test.xl)
    		y := testTerm(test.typ)
    		got := xl.supersetOf(y)
    		if got != test.want {
    			t.Errorf("(%v).supersetOf(%v) = %v; want %v", test.xl, y, got, test.want)
    		}
    	}
    }
    
    func TestTermlistSubsetOf(t *testing.T) {
    	for _, test := range []struct {
    		xl, yl string
    		want   bool
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/termlist_test.go

    		{"~int | string | ∅", "string", true},
    		{"~string | ∅ | 𝓤", "myInt", true},
    	} {
    		xl := maketl(test.xl)
    		y := testTerm(test.typ)
    		got := xl.supersetOf(y)
    		if got != test.want {
    			t.Errorf("(%v).supersetOf(%v) = %v; want %v", test.xl, y, got, test.want)
    		}
    	}
    }
    
    func TestTermlistSubsetOf(t *testing.T) {
    	for _, test := range []struct {
    		xl, yl string
    		want   bool
    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. pilot/pkg/xds/deltatest.go

    	if len(delta.Subscribed) > 0 {
    		// Delta is configured to build only the request resources. Make sense we didn't build anything extra
    		if !wantChanged.SupersetOf(gotChanged) {
    			log.Errorf("%s: TEST for node:%s unexpected resources: %v %v", v3.GetShortType(w.TypeUrl), con.proxy.ID, details, wantChanged.Difference(gotChanged))
    		}
    		// Still make sure we didn't delete anything extra
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jun 13 01:56:28 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  9. pkg/test/framework/components/echo/deployment/builder.go

    		expected.InsertAll(parseList(subset.Annotations[annotation.InjectTemplates.Name])...)
    	}
    	if b.templates == nil || b.templates[c.Name()] == nil {
    		return expected.IsEmpty()
    	}
    
    	return b.templates[c.Name()].SupersetOf(expected)
    }
    
    func parseList(s string) []string {
    	if len(strings.TrimSpace(s)) == 0 {
    		return nil
    	}
    	items := strings.Split(s, ",")
    	for i := range items {
    		items[i] = strings.TrimSpace(items[i])
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jun 06 22:12:34 UTC 2024
    - 12K bytes
    - Viewed (0)
Back to top