mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Don't run time consuming gas interpolation without any data
If the user hasn't set any pressures at all there is no point in trying to interpolate all these data. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
17134be96d
commit
2df1e0b342
1 changed files with 12 additions and 0 deletions
|
@ -369,6 +369,18 @@ void populate_pressure_information(struct dive *dive, struct divecomputer *dc, s
|
|||
pr_track_t *track_pr[MAX_CYLINDERS] = { NULL, };
|
||||
pr_track_t *current = NULL;
|
||||
bool missing_pr = false;
|
||||
bool found_any_pr_data = false;
|
||||
|
||||
/* if we have no pressure data whatsoever, this is pointless, so let's just return */
|
||||
for (i = 0; i < MAX_CYLINDERS; i++) {
|
||||
if (dive->cylinder[i].start.mbar || dive->cylinder[i].sample_start.mbar ||
|
||||
dive->cylinder[i].end.mbar || dive->cylinder[i].sample_end.mbar) {
|
||||
found_any_pr_data = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found_any_pr_data)
|
||||
return;
|
||||
|
||||
for (i = 0; i < pi->nr; i++) {
|
||||
struct plot_data *entry = pi->entry + i;
|
||||
|
|
Loading…
Add table
Reference in a new issue