Commit 89df0711 authored by Brendan O'Dea's avatar Brendan O'Dea

tweaks to exvar.Map

R=dsymonds,rsc
APPROVED=rsc
DELTA=88  (53 added, 17 deleted, 18 changed)
OCL=28452
CL=29008
parent 80543aca
......@@ -66,6 +66,11 @@ func (v *Map) String() string {
return string(b.Data())
}
func (v *Map) Init() *Map {
v.m = make(map[string] Var);
return v
}
func (v *Map) Get(key string) Var {
v.mu.Lock();
defer v.mu.Unlock();
......@@ -157,8 +162,7 @@ func NewInt(name string) *Int {
}
func NewMap(name string) *Map {
v := new(Map);
v.m = make(map[string] Var);
v := new(Map).Init();
Publish(name, v);
return v
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment