From 640f2067d5dcc99064734951cce7f5d86e020781 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 14 Oct 2013 17:24:25 -0700 Subject: Only calculate decompression if the user turned the preference on There's no point in wasting the cycles otherwise. Signed-off-by: Dirk Hohndel --- profile.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/profile.c b/profile.c index c3b984199..5fa0cb959 100644 --- a/profile.c +++ b/profile.c @@ -1086,7 +1086,8 @@ struct plot_info *create_plot_info(struct dive *dive, struct divecomputer *dc, s pi = &gc->pi; /* reset deco information to start the calculation */ - init_decompression(dive); + if (prefs.profile_calc_ceiling) + init_decompression(dive); /* Create the new plot data */ if (last_pi_entry) @@ -1103,7 +1104,9 @@ struct plot_info *create_plot_info(struct dive *dive, struct divecomputer *dc, s populate_pressure_information(dive, dc, pi); /* Then, calculate partial pressures and deco information */ - calculate_deco_information(dive, dc, pi); + if (prefs.profile_calc_ceiling) + calculate_deco_information(dive, dc, pi); + pi->meandepth = dive->dc.meandepth.mm; if (0) /* awesome for debugging - not useful otherwise */ -- cgit v1.2.3-70-g09d2