diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-16 17:35:03 -0800 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-11-17 15:25:26 +0100 |
commit | 8136c2d78b5769c4dfca0f6d68b1a9ccb95f698e (patch) | |
tree | 1ac5fc044f09e37b58f194b8b3ece9c51bb8eb8c /core/profile.c | |
parent | c8a7712ea5587af54c590ad1b57142a3d9af122a (diff) | |
download | subsurface-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.c | 6 |
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; |