Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 595 for elem2 (0.27 sec)

  1. staging/src/k8s.io/apimachinery/pkg/util/cache/lruexpirecache_test.go

    	expectNotEntry(t, c, "elem2")
    	expectEntry(t, c, "elem1", "1")
    	expectEntry(t, c, "elem3", "3")
    	expectEntry(t, c, "elem4", "4")
    	expectEntry(t, c, "elem5", "5")
    }
    
    func TestLRUKeys(t *testing.T) {
    	c := NewLRUExpireCache(4)
    	c.Add("elem1", "1", 10*time.Hour)
    	c.Add("elem2", "2", 10*time.Hour)
    	c.Add("elem3", "3", 10*time.Hour)
    	c.Add("elem4", "4", 10*time.Hour)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Nov 03 18:40:48 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  2. test/typeparam/sliceimp.dir/a.go

    }
    
    // Reduce reduces a []Elem1 to a single value of type Elem2 using
    // a reduction function.
    func Reduce[Elem1, Elem2 any](s []Elem1, initializer Elem2, f func(Elem2, Elem1) Elem2) Elem2 {
    	r := initializer
    	for _, v := range s {
    		r = f(r, v)
    	}
    	return r
    }
    
    // Filter filters values from a slice using a filter function.
    func Filter[Elem any](s []Elem, f func(Elem) bool) []Elem {
    	var r []Elem
    	for _, v := range s {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 30 01:55:58 UTC 2021
    - 3.3K bytes
    - Viewed (0)
  3. src/internal/types/testdata/fixedbugs/issue44799.go

    // license that can be found in the LICENSE file.
    
    package main
    
    func Map[F, T any](s []F, f func(F) T) []T { return nil }
    
    func Reduce[Elem1, Elem2 any](s []Elem1, initializer Elem2, f func(Elem2, Elem1) Elem2) Elem2 { var x Elem2; return x }
    
    func main() {
    	var s []int
    	var f1 func(int) float64
    	var f2 func(float64, int) float64
    	_ = Map[int](s, f1)
    	_ = Map(s, f1)
    	_ = Reduce[int](s, 0, f2)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 02 02:58:32 UTC 2022
    - 530 bytes
    - Viewed (0)
  4. test/typeparam/slices.go

    	return r
    }
    
    // _Reduce reduces a []Elem1 to a single value of type Elem2 using
    // a reduction function.
    func _Reduce[Elem1, Elem2 any](s []Elem1, initializer Elem2, f func(Elem2, Elem1) Elem2) Elem2 {
    	r := initializer
    	for _, v := range s {
    		r = f(r, v)
    	}
    	return r
    }
    
    // _Filter filters values from a slice using a filter function.
    func _Filter[Elem any](s []Elem, f func(Elem) bool) []Elem {
    	var r []Elem
    	for _, v := range s {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 7.8K bytes
    - Viewed (0)
  5. test/escape_reflect.go

    	v := reflect.ValueOf(x) // ERROR "x escapes to heap"
    	return v.Slice(1, 2).Bytes()
    }
    
    func elem1(x *int) int { // ERROR "x does not escape"
    	v := reflect.ValueOf(x)
    	return int(v.Elem().Int())
    }
    
    func elem2(x *string) string { // ERROR "leaking param: x to result ~r0 level=1"
    	v := reflect.ValueOf(x)
    	return string(v.Elem().String())
    }
    
    type S struct {
    	A int
    	B *int
    	C string
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 18:50:24 UTC 2023
    - 13.1K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/Sets.java

                while (itr1.hasNext()) {
                  E elem1 = itr1.next();
                  if (!set2.contains(elem1)) {
                    return elem1;
                  }
                }
                while (itr2.hasNext()) {
                  E elem2 = itr2.next();
                  if (!set1.contains(elem2)) {
                    return elem2;
                  }
                }
                return endOfData();
              }
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Sun Jun 02 13:36:19 UTC 2024
    - 77.3K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/Sets.java

                while (itr1.hasNext()) {
                  E elem1 = itr1.next();
                  if (!set2.contains(elem1)) {
                    return elem1;
                  }
                }
                while (itr2.hasNext()) {
                  E elem2 = itr2.next();
                  if (!set1.contains(elem2)) {
                    return elem2;
                  }
                }
                return endOfData();
              }
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Apr 01 16:15:01 UTC 2024
    - 78.8K bytes
    - Viewed (0)
  8. src/encoding/gob/encoder_test.go

    type Bug1Elem struct {
    	Name string
    	Id   int
    }
    
    type Bug1StructMap map[string]Bug1Elem
    
    func TestMapBug1(t *testing.T) {
    	in := make(Bug1StructMap)
    	in["val1"] = Bug1Elem{"elem1", 1}
    	in["val2"] = Bug1Elem{"elem2", 2}
    
    	b := new(bytes.Buffer)
    	enc := NewEncoder(b)
    	err := enc.Encode(in)
    	if err != nil {
    		t.Fatal("encode:", err)
    	}
    	dec := NewDecoder(b)
    	out := make(Bug1StructMap)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 29.7K bytes
    - Viewed (0)
  9. test/fixedbugs/issue17449.go

    package master
    
    type PriorityList struct {
        elems []interface{}
    }
    
    func (x *PriorityList) Len() int { return len(x.elems) }
    
    func (l *PriorityList) remove(i int) interface{} {
        elem := l.elems[i]
        l.elems = append(l.elems[:i], l.elems[i+1:]...)
        return elem
    }
    
    func (l *PriorityList) Next() interface{} {
        return l.remove(l.Len() - 1)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 1K bytes
    - Viewed (0)
  10. callbacks/associations.go

    						for i := 0; i < f.Len(); i++ {
    							elem := f.Index(i)
    							if !isPtr {
    								elem = elem.Addr()
    							}
    							objs = append(objs, v)
    							elems = reflect.Append(elems, elem)
    
    							relPrimaryValues := make([]interface{}, 0, len(rel.FieldSchema.PrimaryFields))
    							for _, pf := range rel.FieldSchema.PrimaryFields {
    								if pfv, ok := pf.ValueOf(db.Statement.Context, elem); !ok {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Tue Apr 11 03:06:13 UTC 2023
    - 14.3K bytes
    - Viewed (0)
Back to top