summaryrefslogtreecommitdiffstats
path: root/core/profile.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2017-11-16 17:35:03 -0800
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-11-17 15:25:26 +0100
commit8136c2d78b5769c4dfca0f6d68b1a9ccb95f698e (patch)
tree1ac5fc044f09e37b58f194b8b3ece9c51bb8eb8c /core/profile.c
parentc8a7712ea5587af54c590ad1b57142a3d9af122a (diff)
downloadsubsurface-8136c2d78b5769c4dfca0f6d68b1a9ccb95f698e.tar.gz
Clean up confusing code in setup_gas_sensor_pressure()
The "prev" cylinder can never be negative since commit 56c206d19fba ("For more manual gas pressure details"), so remove stale code that checks for a case that cannot happen any more. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'core/profile.c')
-rw-r--r--core/profile.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/core/profile.c b/core/profile.c
index 50e906a09..4aae8b89e 100644
--- a/core/profile.c
+++ b/core/profile.c
@@ -835,8 +835,7 @@ static void setup_gas_sensor_pressure(struct dive *dive, struct divecomputer *dc
if (cyl < 0)
continue;
- if (prev >= 0)
- last[prev] = sec;
+ last[prev] = sec;
prev = cyl;
last[cyl] = sec;
@@ -846,8 +845,7 @@ static void setup_gas_sensor_pressure(struct dive *dive, struct divecomputer *dc
seen[cyl] = 1;
}
}
- if (prev >= 0)
- last[prev] = INT_MAX;
+ last[prev] = INT_MAX;
for (i = 0; i < MAX_CYLINDERS; i++) {
cylinder_t *cyl = dive->cylinder + i;