Skip to content

Commit

Permalink
Do not use std::forward twice on the same object in AmrParticleLocator (
Browse files Browse the repository at this point in the history
#3734)

Bug found by @WeiqunZhang 

The proposed changes:
- [x] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX
users
- [ ] include documentation in the code and/or rst files, if appropriate
  • Loading branch information
atmyers authored Jan 31, 2024
1 parent 4aeeabe commit 47c4f95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Src/Particle/AMReX_ParticleLocator.H
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,13 @@ struct AmrAssignGrid

for (int lev = lev_max; lev >= lev_min; --lev)
{
int grid = m_funcs[lev](p, 0, std::forward<Assignor>(assignor));
int grid = m_funcs[lev](p, 0, assignor);
if (grid >= 0) { return makeTuple(grid, lev); }
}

for (int lev = lev_min; lev >= lev_min; --lev)
{
int grid = m_funcs[lev](p, nGrow, std::forward<Assignor>(assignor));
int grid = m_funcs[lev](p, nGrow, assignor);
if (grid >= 0) { return makeTuple(grid, lev); }
}

Expand Down

0 comments on commit 47c4f95

Please sign in to comment.