Skip to content

Commit

Permalink
Avoid Negation
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l authored Jan 30, 2024
1 parent 11f98db commit b2c02f9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Src/Particle/AMReX_ParticleTransformation.H
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ void copyParticle (const ParticleTileData<T_ParticleType, NAR, NAI>& dst,
AMREX_ASSERT(dst.m_num_runtime_real == src.m_num_runtime_real);
AMREX_ASSERT(dst.m_num_runtime_int == src.m_num_runtime_int );

if constexpr(!T_ParticleType::is_soa_particle) {
dst.m_aos[dst_i] = src.m_aos[src_i];
} else {
if constexpr(T_ParticleType::is_soa_particle) {
dst.m_idcpu[dst_i] = src.m_idcpu[src_i];
} else {
dst.m_aos[dst_i] = src.m_aos[src_i];
}
for (int j = 0; j < NAR; ++j) {
dst.m_rdata[j][dst_i] = src.m_rdata[j][src_i];
Expand Down Expand Up @@ -123,10 +123,10 @@ void swapParticle (const ParticleTileData<T_ParticleType, NAR, NAI>& dst,
AMREX_ASSERT(dst.m_num_runtime_real == src.m_num_runtime_real);
AMREX_ASSERT(dst.m_num_runtime_int == src.m_num_runtime_int );

if constexpr(!T_ParticleType::is_soa_particle) {
amrex::Swap(src.m_aos[src_i], dst.m_aos[dst_i]);
} else {
if constexpr(T_ParticleType::is_soa_particle) {
amrex::Swap(src.m_idcpu[src_i], dst.m_idcpu[dst_i]);
} else {
amrex::Swap(src.m_aos[src_i], dst.m_aos[dst_i]);
}
for (int j = 0; j < NAR; ++j) {
amrex::Swap(dst.m_rdata[j][dst_i], src.m_rdata[j][src_i]);
Expand Down

0 comments on commit b2c02f9

Please sign in to comment.