Bug 1713520 - Remove "else" after "return" in FindInflectionPoints r=nical

Differential Revision: https://phabricator.services.mozilla.com/D116436
This commit is contained in:
Richal Verma 2021-06-17 12:39:16 +00:00
Родитель bb7e748707
Коммит 560f3f056d
1 изменённых файлов: 28 добавлений и 28 удалений

Просмотреть файл

@ -401,37 +401,37 @@ static inline void FindInflectionPoints(
*aT1 = -c / b;
*aCount = 1;
return;
}
double discriminant = b * b - 4 * a * c;
if (discriminant < 0) {
// No inflection points.
*aCount = 0;
} else if (discriminant == 0) {
*aCount = 1;
*aT1 = -b / (2 * a);
} else {
double discriminant = b * b - 4 * a * c;
if (discriminant < 0) {
// No inflection points.
*aCount = 0;
} else if (discriminant == 0) {
*aCount = 1;
*aT1 = -b / (2 * a);
/* Use the following formula for computing the roots:
*
* q = -1/2 * (b + sign(b) * sqrt(b^2 - 4ac))
* t1 = q / a
* t2 = c / q
*/
double q = sqrt(discriminant);
if (b < 0) {
q = b - q;
} else {
/* Use the following formula for computing the roots:
*
* q = -1/2 * (b + sign(b) * sqrt(b^2 - 4ac))
* t1 = q / a
* t2 = c / q
*/
double q = sqrt(discriminant);
if (b < 0) {
q = b - q;
} else {
q = b + q;
}
q *= -1. / 2;
*aT1 = q / a;
*aT2 = c / q;
if (*aT1 > *aT2) {
std::swap(*aT1, *aT2);
}
*aCount = 2;
q = b + q;
}
q *= -1. / 2;
*aT1 = q / a;
*aT2 = c / q;
if (*aT1 > *aT2) {
std::swap(*aT1, *aT2);
}
*aCount = 2;
}
}