mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive site: compare pointers in MultiFilterSortModel::showDive()
To test whether to show a dive, the UUIDs of the filtered-by location and the dive-site of a dive were compared. Since UUIDs are unique (as the name implies), directly compare pointers. Note: this code comes from a time when the filtered-by location was not a pointer, but a copy. Moreover, the if tested first for the same name, then (logical-or) for the same uuid. This makes no sense, as the same dive-site implies the same name. This code likewise can be explained by historic reasons: the filtered-by location may have contained a different name. Swap the order of the conditions: first test for the same object and only of the objects differ, test for the same same. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
724055f0af
commit
e8b3fdb4a6
1 changed files with 1 additions and 1 deletions
|
@ -592,7 +592,7 @@ bool MultiFilterSortModel::showDive(const struct dive *d) const
|
|||
dive_site *ds = d->dive_site;
|
||||
if (!ds)
|
||||
return false;
|
||||
return same_string(ds->name, curr_dive_site->name) || ds->uuid == curr_dive_site->uuid;
|
||||
return ds == curr_dive_site || same_string(ds->name, curr_dive_site->name);
|
||||
}
|
||||
|
||||
if (models.isEmpty())
|
||||
|
|
Loading…
Add table
Reference in a new issue