aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp
diff options
context:
space:
mode:
authorGravatar Luca Fedeli <luca.fedeli@cea.fr> 2023-03-23 22:34:22 +0100
committerGravatar GitHub <noreply@github.com> 2023-03-23 14:34:22 -0700
commit121f4dd882964e6af3ed7fbc4100e67c86b5d574 (patch)
tree3506283c8f69c9d29481a2b7c51c65c68c3eb9b3 /Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp
parent04b96737fe1759e55c8ee83cdb783dbf315f9431 (diff)
downloadWarpX-121f4dd882964e6af3ed7fbc4100e67c86b5d574.tar.gz
WarpX-121f4dd882964e6af3ed7fbc4100e67c86b5d574.tar.zst
WarpX-121f4dd882964e6af3ed7fbc4100e67c86b5d574.zip
Fix "modernize-loop-convert" issues found with clang-tidy (#3774)
* Fix all the modernize-loop-convert issues found with clang-tidy * Fix bug * Implement @EZoni's suggestions
Diffstat (limited to 'Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp')
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp b/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp
index c845a6937..1ea619bbf 100644
--- a/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp
+++ b/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp
@@ -172,8 +172,8 @@ FlushFormatCheckpoint::CheckpointParticles (
const std::string& dir,
const amrex::Vector<ParticleDiag>& particle_diags) const
{
- for (unsigned i = 0, n = particle_diags.size(); i < n; ++i) {
- WarpXParticleContainer* pc = particle_diags[i].getParticleContainer();
+ for (auto& part_diag: particle_diags) {
+ WarpXParticleContainer* pc = part_diag.getParticleContainer();
Vector<std::string> real_names;
Vector<std::string> int_names;
@@ -200,7 +200,7 @@ FlushFormatCheckpoint::CheckpointParticles (
auto runtime_inames = pc->getParticleRuntimeiComps();
for (auto const& x : runtime_inames) { int_names[x.second+0] = x.first; }
- pc->Checkpoint(dir, particle_diags[i].getSpeciesName(), true,
+ pc->Checkpoint(dir, part_diag.getSpeciesName(), true,
real_names, int_names);
}
}