MCPcopy Create free account
hub / github.com/GothenburgBitFactory/taskwarrior / operator<

Method operator<

src/Operation.cpp:50–71  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

48
49////////////////////////////////////////////////////////////////////////////////
50bool Operation::operator<(const Operation& other) const {
51 if (is_create()) {
52 return !other.is_create();
53 } else if (is_update()) {
54 if (other.is_create()) {
55 return false;
56 } else if (other.is_update()) {
57 return get_timestamp() < other.get_timestamp();
58 } else {
59 return true;
60 }
61 } else if (is_delete()) {
62 if (other.is_create() || other.is_update() || other.is_delete()) {
63 return false;
64 } else {
65 return true;
66 }
67 } else if (is_undo_point()) {
68 return !other.is_undo_point();
69 }
70 return false; // not reachable
71}
72
73////////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 5

is_createMethod · 0.45
is_updateMethod · 0.45
get_timestampMethod · 0.45
is_deleteMethod · 0.45
is_undo_pointMethod · 0.45

Tested by

no test coverage detected