Skip to content

Commit 08372b9

Browse files
ax3lWeiqunZhang
andauthored
Simplify 3-way-min
Co-authored-by: Weiqun Zhang <[email protected]>
1 parent 3109d6c commit 08372b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/Particles/WarpXParticleContainer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,9 @@ WarpXParticleContainer::DepositCurrent (WarpXParIter& pti,
359359

360360
// what is the length of the smallest cell edge?
361361
#if defined(WARPX_DIM_3D)
362-
const Real min_dx = dx[0] < dx[1] ? dx[0] : (dx[1] < dx[2] ? dx[1] : dx[2]);
362+
const Real min_dx = std::min({dx[0],dx[1],dx[2]});
363363
#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
364-
const Real min_dx = dx[0] < dx[2] ? dx[0] : dx[2];
364+
const Real min_dx = std::min(dx[0],dx[2]);
365365
#else
366366
const Real min_dx = dx[2];
367367
#endif

0 commit comments

Comments
 (0)