mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Task: Remove std::map inheritance, clean up interface
- Make the Task object's interface more explicit by removing the std::map inheritance. - Using this more explicit interface, remove unneeded ctors in order to allow the compiler to "Do The Right Thing"(tm). This leads to a performance improvement of 12% in the "add" performance test, and 7% for "import".
This commit is contained in:
parent
c248a32cab
commit
8f8ad813cd
12 changed files with 64 additions and 92 deletions
|
@ -124,7 +124,7 @@ int CmdDenotate::execute (std::string&)
|
|||
}
|
||||
}
|
||||
|
||||
if (before != task)
|
||||
if (before.data != task.data)
|
||||
{
|
||||
std::string question = format (STRING_CMD_DENO_CONFIRM,
|
||||
task.identifier (true),
|
||||
|
|
|
@ -205,7 +205,7 @@ void CmdImport::importSingleTask (json::object* obj)
|
|||
if (hasGeneratedEnd)
|
||||
task.set ("end", before.get ("end"));
|
||||
|
||||
if (before != task)
|
||||
if (before.data != task.data)
|
||||
{
|
||||
CmdModify modHelper;
|
||||
modHelper.checkConsistency (before, task);
|
||||
|
|
|
@ -76,7 +76,7 @@ int CmdModify::execute (std::string&)
|
|||
Task before (task);
|
||||
task.modify (Task::modReplace);
|
||||
|
||||
if (before != task)
|
||||
if (before.data != task.data)
|
||||
{
|
||||
// Abort if change introduces inconsistencies.
|
||||
checkConsistency(before, task);
|
||||
|
|
|
@ -137,7 +137,7 @@ int CmdUDAs::execute (std::string& output)
|
|||
std::map <std::string, int> orphans;
|
||||
for (auto& i : filtered)
|
||||
{
|
||||
for (auto& att : i)
|
||||
for (auto& att : i.data)
|
||||
if (att.first.substr (0, 11) != "annotation_" &&
|
||||
context.columns.find (att.first) == context.columns.end ())
|
||||
orphans[att.first]++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue