MCPcopy
hub / github.com/go-task/task / OrderedMap

Function OrderedMap

internal/deepcopy/deepcopy.go:52–65  ·  view source on GitHub ↗
(orig *orderedmap.OrderedMap[K, V])

Source from the content-addressed store, hash-verified

50}
51
52func OrderedMap[K comparable, V any](orig *orderedmap.OrderedMap[K, V]) *orderedmap.OrderedMap[K, V] {
53 if orig.Len() == 0 {
54 return orderedmap.NewOrderedMap[K, V]()
55 }
56 c := orderedmap.NewOrderedMap[K, V]()
57 for pair := orig.Front(); pair != nil; pair = pair.Next() {
58 if copyable, ok := any(pair.Value).(Copier[V]); ok {
59 c.Set(pair.Key, copyable.DeepCopy())
60 } else {
61 c.Set(pair.Key, pair.Value)
62 }
63 }
64 return c
65}
66
67// TraverseStringsFunc runs the given function on every string in the given
68// value by traversing it recursively. If the given value is a string, the

Callers 2

DeepCopyMethod · 0.92
DeepCopyMethod · 0.92

Calls 3

DeepCopyMethod · 0.65
LenMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…