Performance

- It it not necessary to make a copy of all configuration variable names, if the
  Config::const_iterator is sufficient.

(cherry picked from commit 5708cb90780f1f6c8f58f5b549796c4af612b1ab)
This commit is contained in:
Paul Beckingham 2013-05-26 11:40:18 -04:00
parent c16a735040
commit 7b89bc92e1
10 changed files with 95 additions and 128 deletions

View file

@ -47,17 +47,15 @@ void initializeColorRules ()
// Load all the configuration values, filter to only the ones that begin with
// "color.", then store name/value in gsColor, and name in rules.
std::vector <std::string> rules;
std::vector <std::string> variables;
context.config.all (variables);
std::vector <std::string>::iterator v;
for (v = variables.begin (); v != variables.end (); ++v)
Config::const_iterator v;
for (v = context.config.begin (); v != context.config.end (); ++v)
{
if (v->substr (0, 6) == "color.")
if (v->first.substr (0, 6) == "color.")
{
Color c (context.config.get (*v));
gsColor[*v] = c;
Color c (v->second);
gsColor[v->first] = c;
rules.push_back (*v);
rules.push_back (v->first);
}
}