Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 524 for Map (0.16 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. src/unique/handle.go

    			toInsertWeak = weak.Make(toInsert)
    		}
    		return toInsertWeak
    	}
    	var ptr *T
    	for {
    		// Check the map.
    		wp, ok := m.Load(value)
    		if !ok {
    			// Try to insert a new value into the map.
    			wp, _ = m.LoadOrStore(value, newValue())
    		}
    		// Now that we're sure there's a value in the map, let's
    		// try to get the pointer we need out of it.
    		ptr = wp.Strong()
    		if ptr != nil {
    			break
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 16:01:55 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/test/mergelocals_test.go

    	testcases := []struct {
    		vars      []*ir.Name
    		partition map[*ir.Name][]int
    		experr    bool
    	}{
    		{
    			vars: []*ir.Name{v1, v2, v3},
    			partition: map[*ir.Name][]int{
    				v1: []int{0, 1, 2},
    				v2: []int{0, 1, 2},
    				v3: []int{0, 1, 2},
    			},
    			experr: false,
    		},
    		{
    			// invalid mls.v slot -1
    			vars: []*ir.Name{v1, v2, v3},
    			partition: map[*ir.Name][]int{
    				v1: []int{-1, 0},
    				v2: []int{0, 1, 2},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 15:43:53 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  9. src/go/types/self_test.go

    		}
    		var info *Info
    		if writeInfo {
    			info = &Info{
    				Types:      make(map[ast.Expr]TypeAndValue),
    				Defs:       make(map[*ast.Ident]Object),
    				Uses:       make(map[*ast.Ident]Object),
    				Implicits:  make(map[ast.Node]Object),
    				Selections: make(map[*ast.SelectorExpr]*Selection),
    				Scopes:     make(map[ast.Node]*Scope),
    			}
    		}
    		if _, err := conf.Check(path, fset, files, info); err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 23 19:39:00 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/telemetry/internal/config/config.go

    type Config struct {
    	*telemetry.UploadConfig
    	program         map[string]bool
    	goos            map[string]bool
    	goarch          map[string]bool
    	goversion       map[string]bool
    	pgversion       map[pgkey]bool
    	pgcounter       map[pgkey]bool
    	pgcounterprefix map[pgkey]bool
    	pgstack         map[pgkey]bool
    	rate            map[pgkey]float64
    }
    
    type pgkey struct {
    	program, key string
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:57:25 UTC 2024
    - 3.5K bytes
    - Viewed (0)
Back to top