From: David Wells Date: Tue, 9 Apr 2024 23:41:39 +0000 (-0400) Subject: FE_Q_Base: Simplify some code with 'if constexpr'. X-Git-Tag: v9.6.0-rc1~377^2~4 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76028f048eba69248705b1d810f7597473b9e86d;p=dealii.git FE_Q_Base: Simplify some code with 'if constexpr'. --- 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;