mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-25 07:07:42 -05:00
use std::for_each instead of raw loops
This commit is contained in:
1 parent
79919abcf0
commit
c6227b2166
2 files changed
+10
-9
No files matched your search
@@ -154,9 +154,9 @@ namespace Opm
|
||||
const auto rankReports =
|
||||
CollectConvReports { packer, mpi_communicator }(local_report);
|
||||
|
||||
for (const auto& rankReport : rankReports) {
|
||||
combinedReport += rankReport;
|
||||
}
|
||||
std::for_each(rankReports.begin(), rankReports.end(),
|
||||
[&combinedReport](const auto& rankReport)
|
||||
{ combinedReport += rankReport; });
|
||||
|
||||
return combinedReport;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include <opm/simulators/utils/compressPartition.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@@ -51,11 +50,13 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
for (auto& domain : partition) {
|
||||
if (domain >= 0) {
|
||||
domain = compressed[domain - low];
|
||||
}
|
||||
}
|
||||
std::for_each(partition.begin(), partition.end(),
|
||||
[Low = low, &compressed](auto& domain)
|
||||
{
|
||||
if (domain >= 0) {
|
||||
domain = compressed[domain - Low];
|
||||
}
|
||||
});
|
||||
}
|
||||
} // Anonymous namespace
|
||||
|
||||
|
||||
Reference in new issue
Block a user