From: Wolfgang Bangerth Date: Thu, 30 Oct 2014 15:16:04 +0000 (-0500) Subject: Hide a variable in the only scope where it is used. X-Git-Tag: v8.2.0-rc1~93^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45ac4e3439c204aa13a3ab0d7016c12efbc0ac27;p=dealii.git Hide a variable in the only scope where it is used. Also put braces around a longish code block. --- 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);