@@ -42,7 +42,7 @@ void VTKMeshFileImporter::processLines(std::ifstream& file, std::string& line) {
4242
4343 MeshLine line (std::stoi (tokens[1 ]), std::stoi (tokens[2 ]));
4444
45- mLines .push_back (line);
45+ mLines .emplace_back (line);
4646 }
4747}
4848
@@ -73,7 +73,7 @@ void VTKMeshFileImporter::processTriangles(std::ifstream& file, std::string& lin
7373 std::stoi (tokens[3 ])
7474 );
7575
76- mTriangles .push_back (triangle);
76+ mTriangles .emplace_back (triangle);
7777 }
7878}
7979
@@ -162,13 +162,12 @@ void VTKMeshFileImporter::processPoints(std::ifstream& file, std::string& line)
162162 v (0 ) = std::stof (tokens[i]);
163163 v (1 ) = std::stof (tokens[i+1 ]);
164164 v (2 ) = std::stof (tokens[i+2 ]);
165- mVertices .push_back (MeshVertex (v));
165+ mVertices .emplace_back (MeshVertex (v));
166166 }
167167 }
168168}
169169
170170void VTKMeshFileImporter::execute () {
171- getReporter ().setReportMethod (Reporter::COUT);
172171 if (m_filename == " " )
173172 throw Exception (" No filename given to the VTKMeshFileImporter" );
174173
@@ -182,7 +181,7 @@ void VTKMeshFileImporter::execute() {
182181 getline (file, line);
183182 while (!file.eof ()) {
184183 trim (line);
185- if (line.size () == 0 || line[0 ] == ' #' ) {
184+ if (line.empty () || line[0 ] == ' #' ) {
186185 // Skip empty lines and comments
187186 getline (file, line);
188187 continue ;
@@ -196,7 +195,7 @@ void VTKMeshFileImporter::execute() {
196195 }
197196 }
198197
199- if (mVertices .size () == 0 ) {
198+ if (mVertices .empty () ) {
200199 throw Exception (" No points found in file " + m_filename);
201200 }
202201
0 commit comments