GetTimeSteps(): add sanity check
This commit is contained in:
parent
c3c888dc04
commit
d7e185006f
@ -2090,12 +2090,13 @@ QList<int> Calculator::GetPriceSteps(Configuration * /*cfg*/) const {
|
||||
return QList<int>();
|
||||
}
|
||||
|
||||
QList<int> Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex) const {
|
||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ")" << "paymentOptionIndex:" << paymentOptionIndex;
|
||||
QList<int> &Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex) const {
|
||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") paymentOptionIndex:" << paymentOptionIndex;
|
||||
|
||||
if (m_timeSteps.size() > paymentOptionIndex) {
|
||||
//qCritical() << __PRETTY_FUNCTION__ << "timeSteps:" << m_timeSteps;
|
||||
if (!m_timeSteps[paymentOptionIndex].isEmpty()) {
|
||||
return m_timeSteps[paymentOptionIndex];
|
||||
}
|
||||
} else {
|
||||
m_timeSteps.push_back(QList<int>());
|
||||
}
|
||||
@ -2200,7 +2201,7 @@ QList<int> Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex)
|
||||
}
|
||||
}
|
||||
|
||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ")" << "NEW timeSteps:" << m_timeSteps;
|
||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") NEW timeSteps:" << m_timeSteps;
|
||||
|
||||
return m_timeSteps[paymentOptionIndex];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user