From a24b30b8d2c0f875a1eff70f2a724d5e06084107 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 12 Jun 2014 17:03:15 -0700 Subject: [PATCH] config: remove redundant variables --- config/variable.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/config/variable.go b/config/variable.go index ce83097ca..0fd0ebd84 100644 --- a/config/variable.go +++ b/config/variable.go @@ -104,7 +104,6 @@ type variableReplaceWalker struct { key []string loc reflectwalk.Location - m, mk reflect.Value cs []reflect.Value csData interface{} } @@ -133,8 +132,6 @@ func (w *variableReplaceWalker) Map(m reflect.Value) error { } func (w *variableReplaceWalker) MapElem(m, k, v reflect.Value) error { - w.m = m - w.mk = k w.csData = k w.key = append(w.key, k.String()) return nil @@ -187,7 +184,9 @@ func (w *variableReplaceWalker) Primitive(v reflect.Value) error { if w.loc == reflectwalk.MapValue { // If we're in a map, then the only way to set a map value is // to set it directly. - w.m.SetMapIndex(w.mk, resultVal) + m := w.cs[len(w.cs)-1] + mk := w.csData.(reflect.Value) + m.SetMapIndex(mk, resultVal) } else { // Otherwise, we should be addressable setV.Set(resultVal)