Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 329 for Map (0.02 sec)

  1. src/maps/maps.go

    // Values are compared using ==.
    func Equal[M1, M2 ~map[K]V, K, V comparable](m1 M1, m2 M2) bool {
    	if len(m1) != len(m2) {
    		return false
    	}
    	for k, v1 := range m1 {
    		if v2, ok := m2[k]; !ok || v1 != v2 {
    			return false
    		}
    	}
    	return true
    }
    
    // EqualFunc is like Equal, but compares values using eq.
    // Keys are still compared with ==.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 28 20:35:05 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  2. src/runtime/traceexp.go

    	// Experimental events for ExperimentAllocFree.
    
    	// Experimental heap span events. IDs map reversibly to base addresses.
    	traceEvSpan      // heap span exists [timestamp, id, npages, type/class]
    	traceEvSpanAlloc // heap span alloc [timestamp, id, npages, type/class]
    	traceEvSpanFree  // heap span free [timestamp, id]
    
    	// Experimental heap object events. IDs map reversibly to addresses.
    	traceEvHeapObject      // heap object exists [timestamp, id, type]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:47:01 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  3. src/cmd/internal/src/xpos.go

    	return p
    }
    
    // A PosTable tracks Pos -> XPos conversions and vice versa.
    // Its zero value is a ready-to-use PosTable.
    type PosTable struct {
    	baseList []*PosBase
    	indexMap map[*PosBase]int
    	nameMap  map[string]int // Maps file symbol name to index for debug information.
    }
    
    // XPos returns the corresponding XPos for the given pos,
    // adding pos to t if necessary.
    func (t *PosTable) XPos(pos Pos) XPos {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 01 15:52:41 UTC 2023
    - 4.9K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/format.go

    	// Qualify the package unless it's the package being type-checked.
    	if pkg != check.pkg {
    		if check.pkgPathMap == nil {
    			check.pkgPathMap = make(map[string]map[string]bool)
    			check.seenPkgMap = make(map[*Package]bool)
    			check.markImports(check.pkg)
    		}
    		// If the same package name was used by multiple packages, display the full path.
    		if len(check.pkgPathMap[pkg.name]) > 1 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  5. src/maps/maps_test.go

    	}
    	if EqualFunc(m1, (map[int]int)(nil), equal[int]) {
    		t.Errorf("EqualFunc(%v, nil, equal) = true, want false", m1)
    	}
    	if EqualFunc((map[int]int)(nil), m1, equal[int]) {
    		t.Errorf("EqualFunc(nil, %v, equal) = true, want false", m1)
    	}
    	if !EqualFunc[map[int]int, map[int]int](nil, nil, equal[int]) {
    		t.Error("EqualFunc(nil, nil, equal) = false, want true")
    	}
    	if ms := map[int]int{1: 2}; EqualFunc(m1, ms, equal[int]) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 17:05:56 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. 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)
  9. src/internal/types/testdata/fixedbugs/issue61879.go

    		args: args,
    	}
    }
    
    func (k *ImplA[T]) setData(data string) InterfaceA[T] {
    	k.data = data
    	return k
    }
    
    func Foo[M ~map[InterfaceA[T]]V, T comparable, V any](m M) {
    	// DO SOMETHING HERE
    	return
    }
    
    func Bar() {
    	keys := make([]InterfaceA[int], 0, 10)
    	m := make(map[InterfaceA[int]]int)
    	for i := 0; i < 10; i++ {
    		keys = append(keys, NewInterfaceA[int](i))
    		m[keys[i]] = i
    	}
    
    	Foo(m) // panic here
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 15 19:42:56 UTC 2023
    - 1K bytes
    - Viewed (0)
  10. src/mime/type.go

    	"sync"
    )
    
    var (
    	mimeTypes      sync.Map // map[string]string; ".Z" => "application/x-compress"
    	mimeTypesLower sync.Map // map[string]string; ".z" => "application/x-compress"
    
    	// extensions maps from MIME type to list of lowercase file
    	// extensions: "image/jpeg" => [".jpg", ".jpeg"]
    	extensionsMu sync.Mutex // Guards stores (but not loads) on extensions.
    	extensions   sync.Map   // map[string][]string; slice values are append-only.
    )
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 5K bytes
    - Viewed (0)
Back to top