[wpimath] Make LinearFilter::Factorial() constexpr (#3579)

Since BackwardFiniteDifference() gives it a compile-time constant, it
can be evaluated in a constexpr context.
This commit is contained in:
Tyler Veness
2021-09-16 20:45:24 -07:00
committed by GitHub
parent 60ede67abd
commit 4dff873013

View File

@@ -286,7 +286,7 @@ class LinearFilter {
*
* @param n Argument of which to take factorial.
*/
static int Factorial(int n) {
static constexpr int Factorial(int n) {
if (n < 2) {
return 1;
} else {