am cf88cf65: Add a check for ForgettingCurveUtils::decodeProbability.

* commit 'cf88cf65936962373797d14694011b15d0f4c5f0':
  Add a check for ForgettingCurveUtils::decodeProbability.
main
Keisuke Kuroyanagi 2014-03-24 05:29:06 -07:00 committed by Android Git Automerger
commit 683889298e
1 changed files with 2 additions and 1 deletions

View File

@ -72,7 +72,8 @@ const ForgettingCurveUtils::ProbabilityTable ForgettingCurveUtils::sProbabilityT
const int elapsedTimeStepCount = getElapsedTimeStepCount(historicalInfo->getTimeStamp(), const int elapsedTimeStepCount = getElapsedTimeStepCount(historicalInfo->getTimeStamp(),
headerPolicy->getForgettingCurveDurationToLevelDown()); headerPolicy->getForgettingCurveDurationToLevelDown());
return sProbabilityTable.getProbability( return sProbabilityTable.getProbability(
headerPolicy->getForgettingCurveProbabilityValuesTableId(), historicalInfo->getLevel(), headerPolicy->getForgettingCurveProbabilityValuesTableId(),
std::min(std::max(historicalInfo->getLevel(), 0), MAX_LEVEL),
std::min(std::max(elapsedTimeStepCount, 0), MAX_ELAPSED_TIME_STEP_COUNT)); std::min(std::max(elapsedTimeStepCount, 0), MAX_ELAPSED_TIME_STEP_COUNT));
} }