mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
core: fix sorting of events
Fix an embarrassing bug: the less than operator for events was wrong. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
01705a6449
commit
bdfd37c95b
1 changed files with 2 additions and 5 deletions
|
@ -287,11 +287,8 @@ void fixup_dc_duration(struct divecomputer &dc)
|
|||
|
||||
static bool operator<(const event &ev1, const event &ev2)
|
||||
{
|
||||
if (ev1.time.seconds < ev2.time.seconds)
|
||||
return -1;
|
||||
if (ev1.time.seconds > ev2.time.seconds)
|
||||
return 1;
|
||||
return ev1.name < ev2.name;
|
||||
return std::tie(ev1.time.seconds, ev1.name) <
|
||||
std::tie(ev2.time.seconds, ev2.name);
|
||||
}
|
||||
|
||||
int add_event_to_dc(struct divecomputer *dc, struct event ev)
|
||||
|
|
Loading…
Reference in a new issue