Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a warning about pointless unsigned comparison with 0
Browse files Browse the repository at this point in the history
aprokop committed Jun 13, 2024
1 parent b6dbe49 commit 15fcc9f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -95,8 +95,13 @@ KOKKOS_FUNCTION constexpr std::size_t polynomialBasisSize()
static_assert(DIM > 0, "Polynomial basis with no dimension is invalid");

std::size_t result = 1;
for (std::size_t k = 0; k < Kokkos::min(DIM, Degree); ++k)
result = result * (DIM + Degree - k) / (k + 1);

constexpr auto D = Kokkos::min(DIM, Degree);
if constexpr (D > 0)
{
for (std::size_t k = 0; k < D; ++k)
result = result * (DIM + Degree - k) / (k + 1);
}
return result;
}

0 comments on commit 15fcc9f

Please sign in to comment.