mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +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
|
@ -151,17 +151,15 @@ void Column::uda (std::map <std::string, Column*>& all)
|
|||
{
|
||||
// For each UDA, instantiate and initialize ColumnUDA().
|
||||
std::map <std::string, int> udas;
|
||||
std::vector <std::string> names;
|
||||
context.config.all (names);
|
||||
|
||||
std::vector <std::string>::iterator i;
|
||||
for (i = names.begin (); i != names.end (); ++i)
|
||||
Config::const_iterator i;
|
||||
for (i = context.config.begin (); i != context.config.end (); ++i)
|
||||
{
|
||||
if (i->substr (0, 4) == "uda.")
|
||||
if (i->first.substr (0, 4) == "uda.")
|
||||
{
|
||||
std::string::size_type period = 4;
|
||||
if ((period = i->find ('.', period)) != std::string::npos)
|
||||
udas[i->substr (4, period - 4)] = 0;
|
||||
if ((period = i->first.find ('.', period)) != std::string::npos)
|
||||
udas[i->first.substr (4, period - 4)] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue