mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile/cleanup: use local variable to simplify code
The old code wasn't wrong, and likely the compiler turned this into something that wasn't really terrible... but yeah, 5 unnecessary calls to a helper function just bugged me. And I think the new code is much easier to read. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5299d8291d
commit
21d70cbeb1
1 changed files with 5 additions and 4 deletions
|
@ -1103,10 +1103,11 @@ void QMLManager::commitChanges(QString diveId, QString number, QString date, QSt
|
||||||
if (state != "add" && !is_cylinder_used(d, i))
|
if (state != "add" && !is_cylinder_used(d, i))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
get_or_create_cylinder(d, i)->start.mbar = parsePressureToMbar(startpressure[j]);
|
cylinder_t *cyl = get_or_create_cylinder(d, i);
|
||||||
get_cylinder(d, i)->end.mbar = parsePressureToMbar(endpressure[j]);
|
cyl->start.mbar = parsePressureToMbar(startpressure[j]);
|
||||||
if (get_cylinder(d, i)->end.mbar > get_cylinder(d, i)->start.mbar)
|
cyl->end.mbar = parsePressureToMbar(endpressure[j]);
|
||||||
get_cylinder(d, i)->end.mbar = get_cylinder(d, i)->start.mbar;
|
if (cyl->end.mbar > cyl->start.mbar)
|
||||||
|
cyl->end.mbar = cyl->start.mbar;
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue