From: Daniel Arndt Date: Thu, 21 Jun 2018 09:18:43 +0000 (+0200) Subject: Improve formatting in base/data_out_base.cc X-Git-Tag: v9.1.0-rc1~1006^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3505dc4cda55b28dfe5fa4c057286fde578d400f;p=dealii.git Improve formatting in base/data_out_base.cc --- diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 855da02507..48c521b9f3 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -5465,20 +5465,16 @@ namespace DataOutBase const double nblocks = piece_names[0].size(); Assert(nblocks > 0, - ExcMessage("piece_names should be a vector of nonempty vectors.")) + ExcMessage("piece_names should be a vector of nonempty vectors.")); - out - << "!NBLOCKS " << nblocks << '\n'; - for (std::vector>::const_iterator domain = - piece_names.begin(); - domain != piece_names.end(); - ++domain) + out << "!NBLOCKS " << nblocks << '\n'; + for (const auto &domain : piece_names) { - Assert(domain->size() == nblocks, ExcMessage("piece_names should be a vector of equal sized vectors.")) for ( - std::vector::const_iterator subdomain = domain->begin(); - subdomain != domain->end(); - ++subdomain) out - << *subdomain << '\n'; + Assert(domain.size() == nblocks, + ExcMessage( + "piece_names should be a vector of equal sized vectors.")); + for (const auto &subdomain : domain) + out << subdomain << '\n'; } out << std::flush; @@ -5501,27 +5497,19 @@ namespace DataOutBase Assert( nblocks > 0, ExcMessage( - "time_and_piece_names should contain nonempty vectors of filenames for every timestep.")) + "time_and_piece_names should contain nonempty vectors of filenames for every timestep.")); - for (std::vector>>:: - const_iterator domain = times_and_piece_names.begin(); - domain != times_and_piece_names.end(); - ++domain) out - << "!TIME " << domain->first << '\n'; + for (const auto &domain : times_and_piece_names) + out << "!TIME " << domain.first << '\n'; out << "!NBLOCKS " << nblocks << '\n'; - for (std::vector< - std::pair>>::const_iterator domain = - times_and_piece_names.begin(); - domain != times_and_piece_names.end(); - ++domain) + for (const auto &domain : times_and_piece_names) { - Assert(domain->second.size() == nblocks, ExcMessage("piece_names should be a vector of equal sized vectors.")) for ( - std::vector::const_iterator subdomain = - domain->second.begin(); - subdomain != domain->second.end(); - ++subdomain) out - << *subdomain << '\n'; + Assert(domain.second.size() == nblocks, + ExcMessage( + "piece_names should be a vector of equal sized vectors.")); + for (const auto &subdomain : domain.second) + out << subdomain << '\n'; } out << std::flush;