- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 676 for Map (0.02 sec)
-
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) -
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) -
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) -
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) -
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) -
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) -
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) -
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) -
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) -
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)