Skip to content

Commit

Permalink
filter keys
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Jul 2, 2024
1 parent d0e15f2 commit 60a9774
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/solver/hydro/management/HydroErrorsCollector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@ void HydroErrorsCollector::CheckForErrors() const
{
if (!areasErrorMap_.empty())
{
for (const auto& key: areasErrorMap_ | std::views::keys)
for (const auto& value:
areasErrorMap_ | std::views::filter([&key](const auto& p) { return p.first == key; })
| std::views::take(10))
{
for (const auto& value:
areasErrorMap_
| std::views::filter([&key](const auto& p) { return p.first == key; })
| std::views::take(10))
{
logs.error() << "In Area " << value.first << ": " << value.second << " ";
}
logs.error() << "In Area " << value.first << ": " << value.second << " ";
}

throw FatalError("Hydro validation has failed !");
}
}
Expand Down

0 comments on commit 60a9774

Please sign in to comment.