diff options
author | 2023-03-23 22:34:22 +0100 | |
---|---|---|
committer | 2023-03-23 14:34:22 -0700 | |
commit | 121f4dd882964e6af3ed7fbc4100e67c86b5d574 (patch) | |
tree | 3506283c8f69c9d29481a2b7c51c65c68c3eb9b3 /Source/Particles/WarpXParticleContainer.cpp | |
parent | 04b96737fe1759e55c8ee83cdb783dbf315f9431 (diff) | |
download | WarpX-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/Particles/WarpXParticleContainer.cpp')
-rw-r--r-- | Source/Particles/WarpXParticleContainer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Particles/WarpXParticleContainer.cpp b/Source/Particles/WarpXParticleContainer.cpp index 79562e8d3..52b2fbf4c 100644 --- a/Source/Particles/WarpXParticleContainer.cpp +++ b/Source/Particles/WarpXParticleContainer.cpp @@ -806,8 +806,8 @@ amrex::ParticleReal WarpXParticleContainer::sumParticleCharge(bool local) { for (WarpXParIter pti(*this, lev); pti.isValid(); ++pti) { auto& wp = pti.GetAttribs(PIdx::w); - for (unsigned long i = 0; i < wp.size(); i++) { - total_charge += wp[i]; + for (const auto& ww : wp) { + total_charge += ww; } } } |