mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: move time_during_dive_with_offset() to struct dive
Feels natural in a C++ code base. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
28814829e0
commit
fb3a157462
3 changed files with 5 additions and 6 deletions
|
@ -2274,10 +2274,10 @@ timestamp_t dive::endtime() const
|
|||
return when + totaltime().seconds;
|
||||
}
|
||||
|
||||
bool time_during_dive_with_offset(const struct dive *dive, timestamp_t when, timestamp_t offset)
|
||||
bool dive::time_during_dive_with_offset(timestamp_t when, timestamp_t offset) const
|
||||
{
|
||||
timestamp_t start = dive->when;
|
||||
timestamp_t end = dive->endtime();
|
||||
timestamp_t start = when;
|
||||
timestamp_t end = endtime();
|
||||
return start - offset <= when && when <= end + offset;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue