From 28c1dc754d1e0ef6212982a32d620a564f22ac3d Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Sun, 20 Sep 2015 07:52:14 +0200 Subject: [PATCH] Only calculate crushing pressure in VPM-B mode Don't do this expensive calculation when not needed. Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- deco.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deco.c b/deco.c index ec4501bb7..39a6b348c 100644 --- a/deco.c +++ b/deco.c @@ -511,7 +511,8 @@ void add_segment(double pressure, const struct gasmix *gasmix, int period_in_sec tissue_n2_sat[ci] += n2_satmult * pn2_oversat * n2_f; tissue_he_sat[ci] += he_satmult * phe_oversat * he_f; } - calc_crushing_pressure(pressure); + if(prefs.deco_mode == VPMB && in_planner()) + calc_crushing_pressure(pressure); return; }