]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move objects into place rather than swapping them. 16173/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 23 Oct 2023 12:53:44 +0000 (06:53 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 23 Oct 2023 22:54:58 +0000 (16:54 -0600)
source/fe/fe_system.cc

index 5759b45936d52708144cad53a0a448564bdfb7ef..aca2256c400e9e325c0f5c02ed1f0656e7258019 100644 (file)
@@ -963,8 +963,9 @@ FESystem<dim, spacedim>::get_restriction_matrix(
                   (*base_matrices[base])(base_index_i, base_index_j);
               }
 
-          restriction.swap(const_cast<FullMatrix<double> &>(
-            this->restriction[refinement_case - 1][child]));
+          const_cast<FullMatrix<double> &>(
+            this->restriction[refinement_case - 1][child]) =
+            std::move(restriction);
         }
     }
 
@@ -1030,8 +1031,10 @@ FESystem<dim, spacedim>::get_prolongation_matrix(
                 prolongate(i, j) =
                   (*base_matrices[base])(base_index_i, base_index_j);
               }
-          prolongate.swap(const_cast<FullMatrix<double> &>(
-            this->prolongation[refinement_case - 1][child]));
+
+          const_cast<FullMatrix<double> &>(
+            this->prolongation[refinement_case - 1][child]) =
+            std::move(prolongate);
         }
     }
 

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.