Commit e4efccb1 authored by Nate Weibley's avatar Nate Weibley

Don't perform unnecessary growth management

parent f9ebd992
...@@ -786,14 +786,9 @@ void TimeSeriesData::setAverageWindowSize(int windowSize) ...@@ -786,14 +786,9 @@ void TimeSeriesData::setAverageWindowSize(int windowSize)
void TimeSeriesData::append(quint64 ms, double value) void TimeSeriesData::append(quint64 ms, double value)
{ {
dataMutex.lock(); dataMutex.lock();
// Pre- allocate new space // Qt will automatically use a smart growth strategy: http://doc.qt.io/qt-5/containers.html#growth-strategies
// FIXME Check this for validity this->ms.append(ms);
if(static_cast<quint64>(size()) < (count + 100)) { this->value.append(value);
this->ms.resize(size() + 10000);
this->value.resize(size() + 10000);
}
this->ms[count] = ms;
this->value[count] = value;
this->lastValue = value; this->lastValue = value;
this->mean = 0; this->mean = 0;
//QList<double> medianList = QList<double>(); //QList<double> medianList = QList<double>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment