Skip to content

Commit

Permalink
Clang-Tidy 17: performance-noexcept-swap (#3822)
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang authored Mar 19, 2024
1 parent c902981 commit a611acd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Src/Base/AMReX_BoxList.H
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public:
//! Returns a constant reference to the Vector<Box>.
[[nodiscard]] const Vector<Box>& data () const noexcept { return m_lbox; }

void swap (BoxList& rhs) {
void swap (BoxList& rhs) noexcept {
std::swap(m_lbox, rhs.m_lbox);
std::swap(btype, rhs.btype);
}
Expand Down
2 changes: 1 addition & 1 deletion Src/Particle/AMReX_ArrayOfStructs.H
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public:
[[nodiscard]] const ParticleType& operator[] (int i) const { return m_data[i]; }
[[nodiscard]] ParticleType& operator[] (int i) { return m_data[i]; }

void swap (ArrayOfStructs& other)
void swap (ArrayOfStructs& other) noexcept
{
m_data.swap(other.m_data);
}
Expand Down
2 changes: 1 addition & 1 deletion Src/Particle/AMReX_ParticleTile.H
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ struct ParticleTile
return nbytes;
}

void swap (ParticleTile<ParticleType, NArrayReal, NArrayInt, Allocator>& other)
void swap (ParticleTile<ParticleType, NArrayReal, NArrayInt, Allocator>& other) noexcept
{
if constexpr (ParticleType::is_soa_particle) {
GetStructOfArrays().GetIdCPUData().swap(other.GetStructOfArrays().GetIdCPUData());
Expand Down

0 comments on commit a611acd

Please sign in to comment.