mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
pressure interpolation: simplify code
Getting rid of the pointless always-zero pressure now makes it obvious how some of the remaining code can just be removed too: there is no point in re-initializing the pressure_time entries to zero at the segment start, because they started out zero and we just checked that we don't do anything to them before we hit the segment start. Similarly, now that the silly pressure testing is gone, it is obvious that the code for "i < cur" and "i == curr" cases is identical, and the two cases can just be collapsed. Signed-off-by: Linus Torvalds <torvalds@ linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1f7f3c4af5
commit
398cd5d9cc
1 changed files with 1 additions and 11 deletions
|
@ -191,17 +191,7 @@ static struct pr_interpolate_struct get_pr_interpolate_data(pr_track_t *segment,
|
|||
interpolate.pressure_time += entry->pressure_time;
|
||||
break;
|
||||
}
|
||||
if (entry->sec == segment->t_start) {
|
||||
interpolate.acc_pressure_time = 0;
|
||||
interpolate.pressure_time = 0;
|
||||
continue;
|
||||
}
|
||||
if (i < cur) {
|
||||
interpolate.acc_pressure_time += entry->pressure_time;
|
||||
interpolate.pressure_time += entry->pressure_time;
|
||||
continue;
|
||||
}
|
||||
if (i == cur) {
|
||||
if (i <= cur) {
|
||||
interpolate.acc_pressure_time += entry->pressure_time;
|
||||
interpolate.pressure_time += entry->pressure_time;
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue