mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: remove redundant get_dive_dc() calls
In ProfileScene::draw(), the divecomputer was calculated thrice. Remove the two redundant calls. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
dea58bd67c
commit
b1384b286f
1 changed files with 2 additions and 2 deletions
|
@ -439,7 +439,7 @@ void ProfileScene::plotDive(const struct dive *dIn, int dcIn, DivePlannerPointsM
|
||||||
* create_plot_info_new() automatically frees old plot data.
|
* create_plot_info_new() automatically frees old plot data.
|
||||||
*/
|
*/
|
||||||
if (!keepPlotInfo)
|
if (!keepPlotInfo)
|
||||||
create_plot_info_new(d, get_dive_dc_const(d, dc), &plotInfo, planner_ds);
|
create_plot_info_new(d, currentdc, &plotInfo, planner_ds);
|
||||||
|
|
||||||
bool hasHeartBeat = plotInfo.maxhr;
|
bool hasHeartBeat = plotInfo.maxhr;
|
||||||
// For mobile we might want to turn of some features that are normally shown.
|
// For mobile we might want to turn of some features that are normally shown.
|
||||||
|
@ -541,7 +541,7 @@ void ProfileScene::plotDive(const struct dive *dIn, int dcIn, DivePlannerPointsM
|
||||||
qDeleteAll(eventItems);
|
qDeleteAll(eventItems);
|
||||||
eventItems.clear();
|
eventItems.clear();
|
||||||
struct event *event = currentdc->events;
|
struct event *event = currentdc->events;
|
||||||
struct gasmix lastgasmix = get_gasmix_at_time(d, get_dive_dc_const(d, dc), duration_t{1});
|
struct gasmix lastgasmix = get_gasmix_at_time(d, currentdc, duration_t{1});
|
||||||
|
|
||||||
while (event) {
|
while (event) {
|
||||||
// if print mode is selected only draw headings, SP change, gas events or bookmark event
|
// if print mode is selected only draw headings, SP change, gas events or bookmark event
|
||||||
|
|
Loading…
Add table
Reference in a new issue