]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Create std::pair only once.
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Tue, 21 Feb 2006 07:49:55 +0000 (07:49 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Tue, 21 Feb 2006 07:49:55 +0000 (07:49 +0000)
git-svn-id: https://svn.dealii.org/trunk@12435 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/hp_fe_values.cc

index 57fd2d934a1cb738908fb9e2b468ad201ff744ed..0f55bb9afd3afad89603adef50d7b047b76a20fc 100644 (file)
@@ -33,19 +33,20 @@ namespace internal
     FEValuesMap<dim,FEValues>::select_fe_values (const FiniteElement<dim> &fe,
                                                  const unsigned int active_fe_index)
     {
+      std::pair<SmartPointer<const FiniteElement<dim> >, 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<FEValues> (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;
     }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.