- Sort Score
- Result 10 results
- Languages All
Results 141 - 150 of 522 for Map (0.04 sec)
-
src/internal/types/testdata/check/slices.go
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package slices implements various slice algorithms. package slices // Map turns a []T1 to a []T2 using a mapping function. func Map[T1, T2 any](s []T1, f func(T1) T2) []T2 { r := make([]T2, 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 Jan 17 19:54:25 UTC 2023 - 1.5K bytes - Viewed (0) -
test/fixedbugs/issue59404.go
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package p type Interface interface { MonitoredResource() (resType string, labels map[string]string) Done() } func Autodetect() Interface { return func() Interface { Do(func() { var ad, gd Interface go func() { defer gd.Done() ad = aad() }() go func() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 07 15:07:18 UTC 2023 - 935 bytes - Viewed (0) -
src/go/types/mono.go
// // For example, given: // // func f[A, B any]() { // type T int // f[T, map[A]B]() // } // // we construct vertices representing types A, B, and T. Because of // declaration "type T int", we construct edges T<-A and T<-B with // weight 1; and because of instantiation "f[T, map[A]B]" we construct // edges A<-T with weight 0, and B<-A and B<-B with weight 1. //
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Apr 03 18:48:38 UTC 2024 - 9.2K bytes - Viewed (0) -
src/cmd/compile/internal/ssa/sparsemap.go
// in turn, from Briggs and Torczon type sparseEntry struct { key ID val int32 } type sparseMap struct { dense []sparseEntry sparse []int32 } // newSparseMap returns a sparseMap that can map // integers between 0 and n-1 to int32s. func newSparseMap(n int) *sparseMap { return &sparseMap{dense: nil, sparse: make([]int32, n)} } func (s *sparseMap) cap() int { return len(s.sparse) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Oct 31 21:41:06 UTC 2022 - 1.9K bytes - Viewed (0) -
src/runtime/mpagealloc_64bit.go
need := makeAddrRange(chunksBase+needMin*scSize, chunksBase+needMax*scSize) // Subtract any overlap from rounding. We can't re-map memory because // it'll be zeroed. need = need.subtract(have) // If we've got something to map, map it, and update the slice bounds. if need.size() != 0 { sysMap(unsafe.Pointer(need.base.addr()), need.size(), sysStat)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jan 03 11:00:10 UTC 2024 - 9.3K bytes - Viewed (0) -
src/runtime/cgo/handle.go
func (h Handle) Delete() { _, ok := handles.LoadAndDelete(uintptr(h)) if !ok { panic("runtime/cgo: misuse of an invalid Handle") } } var ( handles = sync.Map{} // map[Handle]interface{} handleIdx atomic.Uintptr
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Nov 08 16:59:11 UTC 2023 - 3.6K bytes - Viewed (0) -
src/cmd/internal/pgo/pprof.go
} // createNamedEdgeMap builds a map of callsite-callee edge weights from the // profile-graph. // // Caller should ignore the profile if totalWeight == 0. func createNamedEdgeMap(g *profile.Graph) (edgeMap NamedEdgeMap, totalWeight int64, err error) { seenStartLine := false // Process graph and build various node and edge maps which will // be consumed by AST walk. weight := make(map[NamedCallEdge]int64)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Mar 27 20:20:01 UTC 2024 - 4K bytes - Viewed (0) -
src/cmd/vendor/github.com/google/pprof/profile/legacy_java_profile.go
// populates the Samples in a profile. Returns the remainder of the // buffer after the samples. func parseJavaSamples(pType string, b []byte, p *Profile) ([]byte, map[uint64]*Location, error) { nextNewLine := bytes.IndexByte(b, byte('\n')) locs := make(map[uint64]*Location) for nextNewLine != -1 { line := string(bytes.TrimSpace(b[0:nextNewLine])) if line != "" { sample := javaSampleRx.FindStringSubmatch(line)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Feb 16 15:19:53 UTC 2024 - 8.8K bytes - Viewed (0) -
src/internal/fmtsort/sort_test.go
type sortTest struct { data any // Always a map. print string // Printed result using our custom printer. } var sortTests = []sortTest{ { map[int]string{7: "bar", -3: "foo"}, "-3:foo 7:bar", }, { map[uint8]string{7: "bar", 3: "foo"}, "3:foo 7:bar", }, { map[string]string{"7": "bar", "3": "foo"}, "3:foo 7:bar", }, {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 6.9K bytes - Viewed (0) -
src/runtime/lock_js.go
throw("lock count") } l.key = mutex_unlocked } // One-time notifications. type noteWithTimeout struct { gp *g deadline int64 } var ( notes = make(map[*note]*g) notesWithTimeout = make(map[*note]noteWithTimeout) ) func noteclear(n *note) { n.key = note_cleared } func notewakeup(n *note) { // gp := getg() if n.key == note_woken { throw("notewakeup - double wakeup")
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Nov 21 21:02:20 UTC 2023 - 7.3K bytes - Viewed (0)