Fixed another bug in the getDivisors function

This commit is contained in:
Matthew Ellison
2019-02-09 00:20:10 -05:00
parent bae2a3e3fc
commit 649fe3a66e

View File

@@ -221,6 +221,10 @@ std::vector<T> getDivisors(T num){
if(possibleDivisor != topPossibleDivisor){
divisors.push_back(num / possibleDivisor);
}
//Take care of a few occations where a number was added twice
if(divisors.at(divisors.size() - 1) == (possibleDivisor + 1)){
++possibleDivisor;
}
}
}
//Sort the vector for neatness