mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
feedback: Replace taskDiff method by Task inequality operator
This commit is contained in:
parent
efab724802
commit
4042cbf964
5 changed files with 4 additions and 34 deletions
|
@ -43,35 +43,6 @@ extern Context context;
|
|||
|
||||
static void countTasks (const std::vector <Task>&, const std::string&, int&, int&);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool taskDiff (const Task& before, const Task& after)
|
||||
{
|
||||
// Attributes are all there is, so figure the different attribute names
|
||||
// between before and after.
|
||||
std::vector <std::string> beforeAtts;
|
||||
for (auto& att : before)
|
||||
beforeAtts.push_back (att.first);
|
||||
|
||||
std::vector <std::string> afterAtts;
|
||||
for (auto& att : after)
|
||||
afterAtts.push_back (att.first);
|
||||
|
||||
std::vector <std::string> beforeOnly;
|
||||
std::vector <std::string> afterOnly;
|
||||
listDiff (beforeAtts, afterAtts, beforeOnly, afterOnly);
|
||||
|
||||
if (beforeOnly.size () !=
|
||||
afterOnly.size ())
|
||||
return true;
|
||||
|
||||
for (auto& name : beforeAtts)
|
||||
if (name != "uuid" &&
|
||||
before.get (name) != after.get (name))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string taskDifferences (const Task& before, const Task& after)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue