diff options
author | 2019-11-21 19:17:21 -0500 | |
---|---|---|
committer | 2019-11-21 19:17:21 -0500 | |
commit | a1ba9f4c60a93d1155b7fb04adbbba9b59e5ad0e (patch) | |
tree | 31bf35d7c9134ee37b85695d5e1efa27b5f02376 /Source/Diagnostics/ParticleIO.cpp | |
parent | a58be24722a410cbd5348840f415fa4c4c37f4a5 (diff) | |
download | WarpX-a1ba9f4c60a93d1155b7fb04adbbba9b59e5ad0e.tar.gz WarpX-a1ba9f4c60a93d1155b7fb04adbbba9b59e5ad0e.tar.zst WarpX-a1ba9f4c60a93d1155b7fb04adbbba9b59e5ad0e.zip |
Moved the condition calculation outside of the for loop and updated the unary increment to prefix.
Diffstat (limited to 'Source/Diagnostics/ParticleIO.cpp')
-rw-r--r-- | Source/Diagnostics/ParticleIO.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Diagnostics/ParticleIO.cpp b/Source/Diagnostics/ParticleIO.cpp index 3b7481b8c..4fca8c8cb 100644 --- a/Source/Diagnostics/ParticleIO.cpp +++ b/Source/Diagnostics/ParticleIO.cpp @@ -1,4 +1,3 @@ - #include <MultiParticleContainer.H> #include <WarpX.H> @@ -172,7 +171,8 @@ PhysicalParticleContainer::ConvertUnits(ConvertDirection convert_direction) factor = 1./mass; } - for (int lev=0; lev<=finestLevel(); lev++){ + const auto& finestLevel = finestLevel(); + for (int lev=0; lev<=finestLevel; ++lev){ #ifdef _OPENMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif |