Index: runtime/vm/scopes.cc |
=================================================================== |
--- runtime/vm/scopes.cc (revision 17040) |
+++ runtime/vm/scopes.cc (working copy) |
@@ -294,9 +294,11 @@ |
LocalVariable* LocalScope::LocalLookupVariable(const String& name) const { |
+ const intptr_t name_hash = name.StringHash(); |
for (intptr_t i = 0; i < variables_.length(); i++) { |
LocalVariable* var = variables_[i]; |
- if (var->name().Equals(name) && !var->is_invisible_) { |
+ const bool same_hash = var->name().StringHash() == name_hash; |
+ if (same_hash && !var->is_invisible_ && var->name().Equals(name)) { |
return var; |
} |
} |