From: Ralf Hartmann Date: Tue, 21 Feb 2006 07:49:55 +0000 (+0000) Subject: Create std::pair only once. X-Git-Tag: v8.0.0~12247 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1877ffecff5e209f273dfb66cd6f593052ec2cd;p=dealii.git Create std::pair only once. git-svn-id: https://svn.dealii.org/trunk@12435 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/fe/hp_fe_values.cc b/deal.II/deal.II/source/fe/hp_fe_values.cc index 57fd2d934a..0f55bb9afd 100644 --- a/deal.II/deal.II/source/fe/hp_fe_values.cc +++ b/deal.II/deal.II/source/fe/hp_fe_values.cc @@ -33,19 +33,20 @@ namespace internal FEValuesMap::select_fe_values (const FiniteElement &fe, const unsigned int active_fe_index) { + std::pair >, unsigned int> fe_pair= + std::make_pair(&fe, active_fe_index); // check if the finite element // does not exist as a key in the // map - if (fe_to_fe_values_map.find (std::make_pair(&fe, active_fe_index)) == - fe_to_fe_values_map.end()) + if (fe_to_fe_values_map.find (fe_pair) == fe_to_fe_values_map.end()) // a-ha! doesn't yet, so let's // make it up - fe_to_fe_values_map[std::make_pair(&fe, active_fe_index)] + fe_to_fe_values_map[fe_pair] = boost::shared_ptr (create_fe_values (fe, active_fe_index)); // now there definitely is one! - present_fe_values = fe_to_fe_values_map[std::make_pair (&fe, active_fe_index)]; + present_fe_values = fe_to_fe_values_map[fe_pair]; return *present_fe_values; }