Skip to content

Commit

Permalink
Particle InitBinaryFromFile: Use reference instead of copy
Browse files Browse the repository at this point in the history
This has better performance and the change is now necessary because of
  • Loading branch information
WeiqunZhang committed May 20, 2024
1 parent 5d02c64 commit 6be200a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Src/Particle/AMReX_ParticleInit.H
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ InitFromBinaryFile (const std::string& file,
auto& pmap = m_particles[lev];
auto& tmp_pmap = tmp_particles[lev];

for (auto kv : pmap) {
for (auto& kv : pmap) {
auto& aos = kv.second.GetArrayOfStructs()();
auto& tmp_aos = tmp_pmap[kv.first].GetArrayOfStructs()();

Expand Down

0 comments on commit 6be200a

Please sign in to comment.