mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-30 04:23:24 +02:00
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:
parent
c16a735040
commit
7b89bc92e1
10 changed files with 95 additions and 128 deletions
|
@ -168,16 +168,13 @@ void Command::factory (std::map <std::string, Command*>& all)
|
|||
c = new CmdZshCompletionUuids (); all[c->keyword ()] = c;
|
||||
|
||||
// Instantiate a command object for each custom report.
|
||||
std::vector <std::string> variables;
|
||||
context.config.all (variables);
|
||||
|
||||
std::vector <std::string> reports;
|
||||
std::vector <std::string>::iterator i;
|
||||
for (i = variables.begin (); i != variables.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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue