Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 642 for Map (0.04 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. src/internal/types/testdata/fixedbugs/issue51158.go

    package p
    
    // Type checking the following code should not cause an infinite recursion.
    func f[M map[K]int, K comparable](m M) {
            f(m)
    }
    
    // Equivalent code using mutual recursion.
    func f1[M map[K]int, K comparable](m M) {
            f2(m)
    }
    func f2[M map[K]int, K comparable](m M) {
            f1(m)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 02 02:58:32 UTC 2022
    - 463 bytes
    - Viewed (0)
  6. test/typeparam/builtins.go

    }
    
    func f4[T C5[X], X any](ch T) {
    	close(ch)
    }
    
    // delete
    
    type M0 interface{ int }
    type M1 interface{ map[string]int }
    type M2 interface {
    	map[string]int | map[string]float64
    }
    type M3 interface{ map[string]int | map[rune]int }
    type M4[K comparable, V any] interface{ map[K]V | map[rune]V }
    
    func g1[T M1](m T) {
    	delete(m, "foo")
    }
    
    func g2[T M2](m T) {
    	delete(m, "foo")
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 09:04:48 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  7. src/internal/dag/alg.go

    // license that can be found in the LICENSE file.
    
    package dag
    
    // Transpose reverses all edges in g.
    func (g *Graph) Transpose() {
    	old := g.edges
    
    	g.edges = make(map[string]map[string]bool)
    	for _, n := range g.Nodes {
    		g.edges[n] = make(map[string]bool)
    	}
    
    	for from, tos := range old {
    		for to := range tos {
    			g.edges[to][from] = true
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 04 15:31:44 UTC 2022
    - 1.3K bytes
    - Viewed (0)
  8. test/typeparam/issue47877.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    type Map[K comparable, V any] struct {
            m map[K]V
    }
    
    func NewMap[K comparable, V any]() Map[K, V] {
            return Map[K, V]{m: map[K]V{}}
    }
    
    func (m Map[K, V]) Get(key K) V {
            return m.m[key]
    }
    
    func main() {
            _ = NewMap[int, struct{}]()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 444 bytes
    - Viewed (0)
  9. src/expvar/expvar.go

    	v.f.Store(math.Float64bits(value))
    }
    
    // Map is a string-to-Var map variable that satisfies the [Var] interface.
    type Map struct {
    	m      sync.Map // map[string]Var
    	keysMu sync.RWMutex
    	keys   []string // sorted
    }
    
    // KeyValue represents a single entry in a [Map].
    type KeyValue struct {
    	Key   string
    	Value Var
    }
    
    func (v *Map) String() string {
    	return string(v.appendJSON(nil))
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 21:32:11 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  10. test/fixedbugs/issue62203.go

    	// Remove that 49th entry. m is still growing to 8 buckets,
    	// but a clone of m will only have 4 buckets because it
    	// only needs to fit 48 entries.
    	delete(m, "foo")
    
    	// Clone an 8-bucket map to a 4-bucket map.
    	_ = maps.Clone(m)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 25 16:10:03 UTC 2023
    - 688 bytes
    - Viewed (0)
Back to top