mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add a function to count dives with a specific suit
Checking against the location field probably wasn't the best way to do this... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
01cd09c77a
commit
dae76cdc2d
3 changed files with 16 additions and 1 deletions
14
dive.c
14
dive.c
|
|
@ -2541,6 +2541,20 @@ int count_dives_with_location(const char *location)
|
|||
return counter;
|
||||
}
|
||||
|
||||
// count the dives with exactly the suit
|
||||
int count_dives_with_suit(const char *suit)
|
||||
{
|
||||
int i, counter = 0;
|
||||
struct dive *d;
|
||||
|
||||
for_each_dive (i, d) {
|
||||
if (same_string(d->suit, suit))
|
||||
counter++;
|
||||
}
|
||||
return counter;
|
||||
}
|
||||
|
||||
|
||||
struct dive *merge_dives(struct dive *a, struct dive *b, int offset, bool prefer_downloaded)
|
||||
{
|
||||
struct dive *res = alloc_dive();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue