Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Avoid creating a new ConfigParser::Entry after updating an existing one.

The code prior to this change and 3986181 appeared to have this intent, however it had a couple of issues:
1. It will have dereferenced an iterator that points past the end of the map.
2. It didn't return after updating the entry value.
  • Loading branch information...
commit d43fb04ef259673ad4ec2fe69988a252e4c4f7ec 1 parent 44cf076
@ileitch ileitch authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 vm/config_parser.cpp
View
5 vm/config_parser.cpp
@@ -145,7 +145,10 @@ namespace rubinius {
for(ConfigParser::ConfigVector::iterator i = variables.begin();
i != variables.end();
++i) {
- if (i->first == name) i->second->value = val;
+ if (i->first == name) {
+ i->second->value = val;
+ return;
+ }
}
Entry* entry = new ConfigParser::Entry();
Please sign in to comment.
Something went wrong with that request. Please try again.