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

@ -51,15 +51,12 @@ int CmdReports::execute (std::string& output)
std::vector <std::string> reports;
// Add custom reports.
std::vector <std::string> vars;
context.config.all (vars);
std::vector <std::string>::iterator i;
for (i = vars.begin (); i != vars.end (); ++i)
Config::const_iterator i;
for (i = context.config.begin (); i != context.config.end (); ++i)
{
if (i->substr (0, 7) == "report.")
if (i->first.substr (0, 7) == "report.")
{
std::string report = i->substr (7);
std::string report = i->first.substr (7);
std::string::size_type columns = report.find (".columns");
if (columns != std::string::npos)
reports.push_back (report.substr (0, columns));