mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Desktop: Simplify the get_dive_gas() function.
Remove branches that are always taken or make no difference, as proposed in https://github.com/subsurface/subsurface/pull/3974#pullrequestreview-1674178375. Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
parent
8d3f2e4ca6
commit
07a028b14d
1 changed files with 4 additions and 9 deletions
|
@ -49,16 +49,11 @@ void get_dive_gas(const struct dive *dive, int *o2_p, int *he_p, int *o2max_p)
|
|||
maxo2 = o2;
|
||||
if (o2 < mino2 && maxhe <= 0)
|
||||
mino2 = o2;
|
||||
if (he > maxhe)
|
||||
goto newmax;
|
||||
if (he < maxhe)
|
||||
continue;
|
||||
if (o2 <= maxo2)
|
||||
continue;
|
||||
newmax:
|
||||
if (he > maxhe) {
|
||||
maxhe = he;
|
||||
mino2 = o2;
|
||||
}
|
||||
}
|
||||
/* All air? Show/sort as "air"/zero */
|
||||
if ((!maxhe && maxo2 == O2_IN_AIR && mino2 == maxo2) ||
|
||||
(maxo2 == -1 && maxhe == -1 && mino2 == 1000))
|
||||
|
|
Loading…
Reference in a new issue