mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Task: Convince myself Task comparison is implemented correctly
This commit is contained in:
parent
98991c1c1a
commit
efab724802
1 changed files with 10 additions and 0 deletions
10
src/Task.cpp
10
src/Task.cpp
|
@ -125,6 +125,16 @@ Task& Task::operator= (const Task& other)
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// The uuid and id attributes must be exempt from comparison.
|
||||
//
|
||||
// This performs two tests which are sufficient and necessary for Task
|
||||
// object equality (neglecting uuid and id):
|
||||
// - The attribute set sizes are the same
|
||||
// - For each attribute in the first set, there exists a same
|
||||
// attribute with a same value in the second set
|
||||
//
|
||||
// These two conditions are necessary. They are also sufficient, since there
|
||||
// can be no extra data attribute in the second set, due to the same attribute
|
||||
// set sizes.
|
||||
bool Task::operator== (const Task& other)
|
||||
{
|
||||
if (size () != other.size ())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue