Skip to content

Commit b7951aa

Browse files
committed
fix: use Constexpr
- We can use constexrp here.
1 parent 34e184d commit b7951aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/samurai/mesh.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ namespace samurai
919919
std::size_t subdomain_end = 0;
920920
lcl_type subdomain_cells(start_level, m_domain.origin_point(), m_domain.scaling_factor());
921921
// in 1D MPI, we need a specific partitioning
922-
if (dim == 1)
922+
if constexpr (dim == 1)
923923
{
924924
std::size_t n_cells = m_domain.nb_cells();
925925
std::size_t n_cells_per_subdomain = n_cells / static_cast<std::size_t>(size);
@@ -942,7 +942,7 @@ namespace samurai
942942
}
943943
});
944944
}
945-
else if (dim >= 2)
945+
else if constexpr (dim >= 2)
946946
{
947947
auto subdomain_nb_intervals = m_domain.nb_intervals() / static_cast<std::size_t>(size);
948948
subdomain_start = static_cast<std::size_t>(rank) * subdomain_nb_intervals;

0 commit comments

Comments
 (0)