From 45ac4e3439c204aa13a3ab0d7016c12efbc0ac27 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 30 Oct 2014 10:16:04 -0500 Subject: [PATCH] Hide a variable in the only scope where it is used. Also put braces around a longish code block. --- include/deal.II/fe/mapping_q.h | 46 ++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/include/deal.II/fe/mapping_q.h b/include/deal.II/fe/mapping_q.h index c389450f73..fe9e6e4990 100644 --- a/include/deal.II/fe/mapping_q.h +++ b/include/deal.II/fe/mapping_q.h @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2001 - 2013 by the deal.II authors +// Copyright (C) 2001 - 2014 by the deal.II authors // // This file is part of the deal.II library. // @@ -516,27 +516,31 @@ MappingQ::get_intermediate_points_on_object(const Manifold > &points) const { const unsigned int structdim = TriaIterator::AccessorType::structure_dimension; + // Try backward compatibility option. - const Boundary *boundary = dynamic_cast *>(&manifold); - if (boundary) // This is actually a boundary. Call old methods. - switch (structdim) - { - case 1: - { - const typename Triangulation::line_iterator line = iter; - boundary->get_intermediate_points_on_line(line, points); - return; - } - case 2: - { - const typename Triangulation::quad_iterator quad = iter; - boundary->get_intermediate_points_on_quad(quad, points); - return; - } - default: - Assert(false, ExcInternalError()); - return; - } + if (const Boundary *boundary + = dynamic_cast *>(&manifold)) + // This is actually a boundary. Call old methods. + { + switch (structdim) + { + case 1: + { + const typename Triangulation::line_iterator line = iter; + boundary->get_intermediate_points_on_line(line, points); + return; + } + case 2: + { + const typename Triangulation::quad_iterator quad = iter; + boundary->get_intermediate_points_on_quad(quad, points); + return; + } + default: + Assert(false, ExcInternalError()); + return; + } + } else { std::vector > sp(GeometryInfo::vertices_per_cell); -- 2.39.5