Skip to content
Snippets Groups Projects
Commit 061c80b1 authored by Dmitri Naumov's avatar Dmitri Naumov Committed by Tom Fischer
Browse files

[PL/Out] Use ranges transform replacing for-loop

parent a6707bbc
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
#include <cassert> #include <cassert>
#include <exception> #include <exception>
#include <fstream> #include <fstream>
#include <range/v3/algorithm/transform.hpp>
#include <range/v3/range/conversion.hpp>
#include <vector> #include <vector>
#include "AddProcessDataToMesh.h" #include "AddProcessDataToMesh.h"
...@@ -417,13 +419,12 @@ void Output::doOutputNonlinearIteration( ...@@ -417,13 +419,12 @@ void Output::doOutputNonlinearIteration(
std::vector<std::string> Output::getFileNamesForOutput() const std::vector<std::string> Output::getFileNamesForOutput() const
{ {
std::vector<std::string> output_names; auto construct_filename = ranges::views::transform(
for (auto const& output_name : _mesh_names_for_output) [&](auto const& output_name)
{ { return _output_format->constructFilename(output_name, 0, 0, 0); });
output_names.push_back(
_output_format->constructFilename(output_name, 0, 0, 0)); return _mesh_names_for_output | construct_filename |
} ranges::to<std::vector>;
return output_names;
} }
std::vector<double> calculateUniqueFixedTimesForAllOutputs( std::vector<double> calculateUniqueFixedTimesForAllOutputs(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment