mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Profile: pass by reference rather than by value for large struct
Addresses LGTM.com suggestion. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4524e2b0b3
commit
c7bb67c5be
4 changed files with 18 additions and 18 deletions
|
|
@ -718,7 +718,7 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict
|
|||
cylinderPressureAxis->setMinimum(plotInfo.minpressure);
|
||||
cylinderPressureAxis->setMaximum(plotInfo.maxpressure);
|
||||
#ifndef SUBSURFACE_MOBILE
|
||||
rulerItem->setPlotInfo(plotInfo);
|
||||
rulerItem->setPlotInfo(&plotInfo);
|
||||
#endif
|
||||
|
||||
#ifdef SUBSURFACE_MOBILE
|
||||
|
|
|
|||
|
|
@ -152,11 +152,11 @@ RulerNodeItem2 *RulerItem2::destNode() const
|
|||
return dest;
|
||||
}
|
||||
|
||||
void RulerItem2::setPlotInfo(plot_info info)
|
||||
void RulerItem2::setPlotInfo(plot_info *info)
|
||||
{
|
||||
pInfo = info;
|
||||
dest->setPlotInfo(info);
|
||||
source->setPlotInfo(info);
|
||||
pInfo = *info;
|
||||
dest->setPlotInfo(*info);
|
||||
source->setPlotInfo(*info);
|
||||
dest->recalculate();
|
||||
source->recalculate();
|
||||
recalculate();
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public:
|
|||
explicit RulerItem2();
|
||||
void recalculate();
|
||||
|
||||
void setPlotInfo(struct plot_info pInfo);
|
||||
void setPlotInfo(struct plot_info *pInfo);
|
||||
RulerNodeItem2 *sourceNode() const;
|
||||
RulerNodeItem2 *destNode() const;
|
||||
void setAxis(DiveCartesianAxis *time, DiveCartesianAxis *depth);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue