MCPcopy
hub / github.com/uber-go/nilaway / Store

Method Store

util/orderedmap/orderedmap.go:77–87  ·  view source on GitHub ↗

Store stores the value in the map for the key, overwriting the previous value if the key exists.

(key K, value V)

Source from the content-addressed store, hash-verified

75
76// Store stores the value in the map for the key, overwriting the previous value if the key exists.
77func (m *OrderedMap[K, V]) Store(key K, value V) {
78 m.rehydrate()
79
80 if p := m.inner[key]; p != nil {
81 p.Value = value
82 return
83 }
84 p := &Pair[K, V]{Key: key, Value: value}
85 m.Pairs = append(m.Pairs, p)
86 m.inner[key] = p
87}
88
89// rehydrate ensures that the inner map is up-to-date with the Pairs slice. This can happen when
90// the OrderedMap is serialized and deserialized via gob encoding (the inner map is unexported and

Callers 15

TestFact_CodecFunction · 0.80
extractAffiliationsMethod · 0.80
addEntryMethod · 0.80
copyMethod · 0.80
StoreDeterminedMethod · 0.80
StoreImplicationMethod · 0.80
ExportMethod · 0.80
copyMethod · 0.80
inferredValDiffFunction · 0.80
TestLoadStoreFunction · 0.80
TestRangeFunction · 0.80

Calls 1

rehydrateMethod · 0.95

Tested by 6

TestFact_CodecFunction · 0.64
TestLoadStoreFunction · 0.64
TestRangeFunction · 0.64
TestStoringInterfacesFunction · 0.64
TestEncodingFunction · 0.64