From 76028f048eba69248705b1d810f7597473b9e86d Mon Sep 17 00:00:00 2001 From: David Wells Date: Tue, 9 Apr 2024 19:41:39 -0400 Subject: [PATCH] FE_Q_Base: Simplify some code with 'if constexpr'. --- source/fe/fe_q_base.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/source/fe/fe_q_base.cc b/source/fe/fe_q_base.cc index f1c8e2150b..1959071618 100644 --- a/source/fe/fe_q_base.cc +++ b/source/fe/fe_q_base.cc @@ -1641,15 +1641,12 @@ FE_Q_Base::has_support_on_face( ExcInternalError()); // in 2d, the line is the face, so get the line index - if (dim == 2) + if constexpr (dim == 2) return (line_index == face_index); - else if (dim == 3) + else if constexpr (dim == 3) { - // silence compiler warning - const unsigned int lines_per_face = - dim == 3 ? GeometryInfo::lines_per_face : 1; // see whether the given line is on the given face. - for (unsigned int l = 0; l < lines_per_face; ++l) + for (unsigned int l = 0; l < GeometryInfo<3>::lines_per_face; ++l) if (GeometryInfo<3>::face_to_cell_lines(face_index, l) == line_index) return true; -- 2.39.5