mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user