mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: move has_dive() function into struct divelist
Seems natural in a C++ code base. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
60c7b503cf
commit
576d3a3bc6
4 changed files with 5 additions and 5 deletions
|
|
@ -881,9 +881,9 @@ struct dive *dive_table::find_next_visible_dive(timestamp_t when)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
bool has_dive(unsigned int deviceid, unsigned int diveid)
|
||||
bool dive_table::has_dive(unsigned int deviceid, unsigned int diveid) const
|
||||
{
|
||||
return std::any_of(divelog.dives.begin(), divelog.dives.end(), [deviceid,diveid] (auto &d) {
|
||||
return std::any_of(begin(), end(), [deviceid,diveid] (auto &d) {
|
||||
return std::any_of(d->dcs.begin(), d->dcs.end(), [deviceid,diveid] (auto &dc) {
|
||||
return dc.deviceid == deviceid && dc.diveid == diveid;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue