Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 643 for Map (0.02 sec)

  1. src/cmd/compile/internal/types2/map.go

    package types2
    
    // A Map represents a map type.
    type Map struct {
    	key, elem Type
    }
    
    // NewMap returns a new map for the given key and element types.
    func NewMap(key, elem Type) *Map {
    	return &Map{key: key, elem: elem}
    }
    
    // Key returns the key type of map m.
    func (m *Map) Key() Type { return m.key }
    
    // Elem returns the element type of map m.
    func (m *Map) Elem() Type { return m.elem }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 01 22:17:50 UTC 2021
    - 659 bytes
    - Viewed (0)
  2. src/go/types/map.go

    // Source: ../../cmd/compile/internal/types2/map.go
    
    // Copyright 2011 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package types
    
    // A Map represents a map type.
    type Map struct {
    	key, elem Type
    }
    
    // NewMap returns a new map for the given key and element types.
    func NewMap(key, elem Type) *Map {
    	return &Map{key: key, elem: elem}
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 781 bytes
    - Viewed (0)
  3. src/cmd/compile/internal/syntax/testdata/map.go

    	val         V
    	left, right *node[K, V]
    }
    
    // New returns a new map.
    func New[K, V any](compare func(K, K) int) *Map[K, V] {
            return &Map[K, V]{compare: compare}
    }
    
    // find looks up key in the map, and returns either a pointer
    // to the node holding key, or a pointer to the location where
    // such a node would go.
    func (m *Map[K, V]) find(key K) **node[K, V] {
    	pn := &m.root
    	for *pn != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 30 18:02:18 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  4. src/internal/abi/map.go

    // Copyright 2023 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package abi
    
    // Map constants common to several packages
    // runtime/runtime-gdb.py:MapTypePrinter contains its own copy
    const (
    	// Maximum number of key/elem pairs a bucket can hold.
    	MapBucketCountBits = 3 // log2 of number of elements in a bucket.
    	MapBucketCount     = 1 << MapBucketCountBits
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 20:09:01 UTC 2024
    - 719 bytes
    - Viewed (0)
  5. test/typeparam/map.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    import (
    	"fmt"
    	"reflect"
    	"strconv"
    )
    
    // Map calls the function f on every element of the slice s,
    // returning a new slice of the results.
    func mapper[F, T any](s []F, f func(F) T) []T {
    	r := make([]T, len(s))
    	for i, v := range s {
    		r[i] = f(v)
    	}
    	return r
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 885 bytes
    - Viewed (0)
  6. src/internal/types/testdata/check/map0.go

    	key         K
    	val         V
    	left, right *node[K, V]
    }
    
    // New returns a new map.
    func New[K, V any](compare func(K, K) int) *Map[K, V] {
            return &Map[K, V]{compare: compare}
    }
    
    // find looks up key in the map, and returns either a pointer
    // to the node holding key, or a pointer to the location where
    // such a node would go.
    func (m *Map[K, V]) find(key K) **node[K, V] {
    	pn := &m.root
    	for *pn != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:25 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  7. src/log/slog/slogtest_test.go

    		m := top
    		for _, key := range keys[:len(keys)-1] {
    			x, ok := m[key]
    			var m2 map[string]any
    			if !ok {
    				m2 = map[string]any{}
    				m[key] = m2
    			} else {
    				m2, ok = x.(map[string]any)
    				if !ok {
    					return nil, fmt.Errorf("value for %q in composite key %q is not map[string]any", key, k)
    
    				}
    			}
    			m = m2
    		}
    		m[keys[len(keys)-1]] = value
    		s = rest
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 10 12:50:22 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  8. src/cmd/go/internal/imports/tags.go

    	}
    	return tags
    }
    
    var (
    	anyTags     map[string]bool
    	anyTagsOnce sync.Once
    )
    
    // AnyTags returns a special set of build tags that satisfy nearly all
    // build tag expressions. Only "ignore" and malformed build tag requirements
    // are considered false.
    func AnyTags() map[string]bool {
    	anyTagsOnce.Do(func() {
    		anyTags = map[string]bool{"*": true}
    	})
    	return anyTags
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 26 17:43:59 UTC 2022
    - 1.3K bytes
    - Viewed (0)
  9. test/typeparam/mapsimp.dir/main.go

    	}
    	a.Add(mc, map[int]int{16: 32})
    	want := map[int]int{1: 2, 2: 4, 4: 8, 8: 16, 16: 32}
    	if !a.Equal(mc, want) {
    		panic(fmt.Sprintf("a.Add result = %v, want %v", mc, want))
    	}
    }
    
    func TestSub() {
    	mc := a.Copy(m1)
    	a.Sub(mc, mc)
    	if len(mc) > 0 {
    		panic(fmt.Sprintf("a.Sub(%v, %v) = %v, want empty map", m1, m1, mc))
    	}
    	mc = a.Copy(m1)
    	a.Sub(mc, map[int]int{1: 0})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 24 02:14:15 UTC 2022
    - 3.6K bytes
    - Viewed (0)
  10. test/codegen/maps.go

    package codegen
    
    // This file contains code generation tests related to the handling of
    // map types.
    
    // ------------------- //
    //     Access Const    //
    // ------------------- //
    
    // Direct use of constants in fast map access calls (Issue #19015).
    
    func AccessInt1(m map[int]int) int {
    	// amd64:"MOV[LQ]\t[$]5"
    	return m[5]
    }
    
    func AccessInt2(m map[int]int) bool {
    	// amd64:"MOV[LQ]\t[$]5"
    	_, ok := m[5]
    	return ok
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 23 15:51:32 UTC 2023
    - 3.6K bytes
    - Viewed (0)
Back to top