]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use emplace_back() over push_back().
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 18 Nov 2021 22:40:06 +0000 (15:40 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 19 Nov 2021 00:00:49 +0000 (17:00 -0700)
source/grid/grid_in.cc

index ee81203adbd9afc68eb4baf8d6b72515d5aa618a..33b1010086f8052877dd9368ce3fb23bedd9b951 100644 (file)
@@ -1702,12 +1702,12 @@ GridIn<dim, spacedim>::read_comsol_mphtxt(std::istream &in)
             {
               if (spacedim == 1)
                 {
-                  cells.push_back({});
+                  cells.emplace_back();
                   cells.back().vertices = vertices_for_this_element;
                 }
               else
                 {
-                  subcelldata.boundary_lines.push_back({});
+                  subcelldata.boundary_lines.emplace_back();
                   subcelldata.boundary_lines.back().vertices =
                     vertices_for_this_element;
                 }
@@ -1716,12 +1716,12 @@ GridIn<dim, spacedim>::read_comsol_mphtxt(std::istream &in)
             {
               if (spacedim == 2)
                 {
-                  cells.push_back({});
+                  cells.emplace_back();
                   cells.back().vertices = vertices_for_this_element;
                 }
               else
                 {
-                  subcelldata.boundary_quads.push_back({});
+                  subcelldata.boundary_quads.emplace_back();
                   subcelldata.boundary_quads.back().vertices =
                     vertices_for_this_element;
                 }
@@ -1730,7 +1730,7 @@ GridIn<dim, spacedim>::read_comsol_mphtxt(std::istream &in)
             {
               if (spacedim == 3)
                 {
-                  cells.push_back({});
+                  cells.emplace_back();
                   cells.back().vertices = vertices_for_this_element;
                 }
               else

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.