make use of Bindings typedef
authorThiago Farina <tfarina@chromium.org>
Fri, 4 Dec 2015 22:31:19 +0000 (20:31 -0200)
committerThiago Farina <tfarina@chromium.org>
Fri, 4 Dec 2015 22:31:19 +0000 (20:31 -0200)
Looks like we declared this typedef but never used it.

It seems we just forgot to use it so this patch makes uses of it now.
Otherwise we could just delete it.

src/eval_env.cc
src/eval_env.h

index e991d21..937a673 100644 (file)
@@ -55,7 +55,7 @@ void Rule::AddBinding(const string& key, const EvalString& val) {
 }
 
 const EvalString* Rule::GetBinding(const string& key) const {
-  map<string, EvalString>::const_iterator i = bindings_.find(key);
+  Bindings::const_iterator i = bindings_.find(key);
   if (i == bindings_.end())
     return NULL;
   return &i->second;
index 28c4d16..999ce42 100644 (file)
@@ -57,7 +57,6 @@ struct Rule {
 
   const string& name() const { return name_; }
 
-  typedef map<string, EvalString> Bindings;
   void AddBinding(const string& key, const EvalString& val);
 
   static bool IsReservedBinding(const string& var);
@@ -69,7 +68,8 @@ struct Rule {
   friend struct ManifestParser;
 
   string name_;
-  map<string, EvalString> bindings_;
+  typedef map<string, EvalString> Bindings;
+  Bindings bindings_;
 };
 
 /// An Env which contains a mapping of variables to values