Search Options

Results per page
Sort
Preferred Languages
Advance

Results 81 - 90 of 642 for Map (0.02 sec)

  1. test/fixedbugs/issue59411.go

    		f()
    		g()
    	}
    }
    
    func f() {
    	// Allocate map.
    	m := map[float64]int{}
    	// Fill to just before a growth trigger.
    	const N = 13 << 4 // 6.5 * 2 * 2^k
    	for i := 0; i < N; i++ {
    		m[math.NaN()] = i
    	}
    	// Trigger growth.
    	m[math.NaN()] = N
    
    	// Iterate through map.
    	i := 0
    	for range m {
    		if i == 6 {
    			// Partway through iteration, clear the map.
    			clear(m)
    		} else if i > 6 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Apr 08 05:25:04 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  2. test/fixedbugs/issue52590.dir/a.go

    func UnsafeAdd() {
    	_ = unsafe.Add(unsafeAdd())
    }
    
    func UnsafeSlice() {
    	_ = unsafe.Slice(unsafeSlice())
    }
    
    func appendArgs() ([]int, int) {
    	return []int{}, 0
    }
    
    func deleteArgs() (map[int]int, int) {
    	return map[int]int{}, 0
    }
    
    func ints() (int, int) {
    	return 1, 1
    }
    
    func float64s() (float64, float64) {
    	return 0, 0
    }
    
    func slices() ([]int, []int) {
    	return []int{}, []int{}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 28 18:02:40 UTC 2022
    - 933 bytes
    - Viewed (0)
  3. src/archive/zip/register.go

    	defer r.mu.Unlock()
    	var err error
    	if r.fr != nil {
    		err = r.fr.Close()
    		flateReaderPool.Put(r.fr)
    		r.fr = nil
    	}
    	return err
    }
    
    var (
    	compressors   sync.Map // map[uint16]Compressor
    	decompressors sync.Map // map[uint16]Decompressor
    )
    
    func init() {
    	compressors.Store(Store, Compressor(func(w io.Writer) (io.WriteCloser, error) { return &nopCloser{w}, nil }))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 18:36:46 UTC 2023
    - 3.7K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/testdata/map2.go

    // license that can be found in the LICENSE file.
    
    // This file is like map.go, but instead of importing chans, it contains
    // the necessary functionality at the end of the file.
    
    // Package orderedmap provides an ordered map, implemented as a binary tree.
    package orderedmap
    
    // Map is an ordered map.
    type Map[K, V any] struct {
    	root    *node[K, V]
    	compare func(K, K) int
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 01 12:49:49 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  5. src/internal/types/testdata/check/map1.go

    // license that can be found in the LICENSE file.
    
    // This file is like map.go2, but instead if importing chans, it contains
    // the necessary functionality at the end of the file.
    
    // Package orderedmap provides an ordered map, implemented as a binary tree.
    package orderedmap
    
    // Map is an ordered map.
    type Map[K, V any] struct {
    	root    *node[K, V]
    	compare func(K, K) int
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 02 02:58:32 UTC 2022
    - 3.4K bytes
    - Viewed (0)
  6. test/typeparam/mdempsky/17.go

    	for v = range chanOf(zero[V]()) {
    	}
    	return
    }
    
    func RangeMapAny[K comparable, V any]() (k, v any) {
    	for k, v = range map[K]V{zero[K](): zero[V]()} {
    	}
    	return
    }
    
    func RangeMapIface[K interface {
    	iface
    	comparable
    }, V iface]() (k, v iface) {
    	for k, v = range map[K]V{zero[K](): zero[V]()} {
    	}
    	return
    }
    
    func RangeSliceAny[V any]() (k, v any) {
    	for k, v = range []V{zero[V]()} {
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 10 21:35:49 UTC 2022
    - 2.1K bytes
    - Viewed (0)
  7. src/go/ast/commentmap_test.go

    		}
    	}
    
    	// verify that no comments got lost
    	if n := len(cmap.Comments()); n != len(f.Comments) {
    		t.Errorf("got %d comment groups in map; want %d", n, len(f.Comments))
    	}
    
    	// support code to update test:
    	// set genMap to true to generate res map
    	const genMap = false
    	if genMap {
    		out := make([]string, 0, len(cmap))
    		for n, list := range cmap {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 09 15:35:30 UTC 2022
    - 3.9K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/ssa/flags_test.go

    import (
    	"runtime"
    	"testing"
    )
    
    func TestAddFlagsNative(t *testing.T) {
    	var numbers = []int64{
    		1, 0, -1,
    		2, -2,
    		1<<63 - 1, -1 << 63,
    	}
    	coverage := map[flagConstant]bool{}
    	for _, x := range numbers {
    		for _, y := range numbers {
    			a := addFlags64(x, y)
    			b := flagRegister2flagConstant(asmAddFlags(x, y), false)
    			if a != b {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 04 19:36:17 UTC 2022
    - 2.5K bytes
    - Viewed (0)
  9. src/internal/types/testdata/fixedbugs/issue49179.go

    }
    
    // test case from the issue
    
    type SliceConstraint[T any] interface {
    	[]T
    }
    
    func Map[S SliceConstraint[E], E any](s S, f func(E) E) S {
    	return s
    }
    
    type MySlice []int
    
    func f(s MySlice) {
    	Map[MySlice /* ERROR "MySlice does not satisfy SliceConstraint[int] (possibly missing ~ for []int in SliceConstraint[int])" */, int](s, nil)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:27 UTC 2023
    - 964 bytes
    - Viewed (0)
  10. src/encoding/gob/type_test.go

    	}
    }
    
    func TestMapType(t *testing.T) {
    	var m map[string]int
    	mapStringInt := getTypeUnlocked("map", reflect.TypeOf(m))
    	var newm map[string]int
    	newMapStringInt := getTypeUnlocked("map1", reflect.TypeOf(newm))
    	if mapStringInt != newMapStringInt {
    		t.Errorf("second registration of map[string]int creates new type")
    	}
    	var b map[string]bool
    	mapStringBool := getTypeUnlocked("", reflect.TypeOf(b))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 01 14:26:13 UTC 2023
    - 6.1K bytes
    - Viewed (0)
Back to top