profile: remove TankItem::plotEndTime member variable

That variable was only used in a single function and
always reset at the beginning of the function. No point
in being a member variable.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-10-08 21:11:37 +02:00 committed by Dirk Hohndel
parent 118700fd18
commit d97cc8d4d5
2 changed files with 2 additions and 6 deletions

View file

@ -12,7 +12,6 @@ static const double border = 1.0;
TankItem::TankItem(const DiveCartesianAxis &axis, double dpr) :
hAxis(axis),
plotEndTime(-1),
dpr(dpr)
{
QColor red(PERSIANRED1);
@ -71,14 +70,12 @@ void TankItem::setData(const struct plot_info *plotInfo, const struct dive *d)
return;
// If there is nothing to plot, quit early.
if (plotInfo->nr <= 0) {
plotEndTime = -1;
if (plotInfo->nr <= 0)
return;
}
// Find correct end of the dive plot for correct end of the tankbar.
const struct plot_data *last_entry = &plotInfo->entry[plotInfo->nr - 1];
plotEndTime = last_entry->sec;
int plotEndTime = last_entry->sec;
// We don't have enougth data to calculate things, quit.
if (plotEndTime < 0)

View file

@ -20,7 +20,6 @@ public:
private:
void createBar(int startTime, int stopTime, struct gasmix gas);
const DiveCartesianAxis &hAxis;
int plotEndTime;
double dpr;
QBrush air, nitrox, oxygen, trimix;
QList<QGraphicsRectItem *> rects;