MCPcopy Create free account
hub / github.com/PolyhedraZK/ExpanderCompilerCollection / Set

Method Set

ecgo/utils/map.go:30–47  ·  view source on GitHub ↗

sets the value of e to v

(e Hashable, v interface{})

Source from the content-addressed store, hash-verified

28
29// sets the value of e to v
30func (m Map) Set(e Hashable, v interface{}) {
31 h := e.HashCode()
32 s, ok := m[h]
33 if !ok {
34 s = make([]mapEntry, 0, 1)
35 } else {
36 for _, x := range s {
37 if x.e.EqualI(e) {
38 x.v = v
39 return
40 }
41 }
42 }
43 m[h] = append(s, mapEntry{
44 e: e,
45 v: v,
46 })
47}
48
49// adds (e, v) to the map, returns the current value when e already exists
50func (m Map) Add(e Hashable, v interface{}) interface{} {

Callers 7

CompileFunction · 0.80
ProveMethod · 0.80
VerifyMethod · 0.80
FromInterfaceFunction · 0.80
rebuildSliceVariablesFunction · 0.80
IdentityHintFunction · 0.80
rangeProofHintFunction · 0.80

Calls 2

HashCodeMethod · 0.80
EqualIMethod · 0.80

Tested by

no test coverage detected