mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: qualify Swap with Foam:: prefix (visibility)
- drop unnecessary Foam::Swap specializations when MoveConstructible
and MoveAssignable already apply. The explicit redirect to swap
member functions was needed before proper move semantics where
added.
Removed specializations: autoPtr, refPtr, tmp, UList.
Retained specialization: DynamicList, FixedList.
Special handling for DynamicList is only to accommodate dissimilar
sizing template parameters (which probably doesn't occur in
practice).
Special handling for FixedList to apply element-wise swapping.
- use std::swap for primitives. No need to mask with Foam::Swap wrapper
This commit is contained in:
@ -143,10 +143,10 @@ void Foam::fileFormats::ensightMeshReader::setHandedness
|
||||
// if (((x ^ y) & z) < 0)
|
||||
// {
|
||||
// // Flipped hex
|
||||
// Swap(verts[0], verts[4]);
|
||||
// Swap(verts[1], verts[5]);
|
||||
// Swap(verts[2], verts[6]);
|
||||
// Swap(verts[3], verts[7]);
|
||||
// std::swap(verts[0], verts[4]);
|
||||
// std::swap(verts[1], verts[5]);
|
||||
// std::swap(verts[2], verts[6]);
|
||||
// std::swap(verts[3], verts[7]);
|
||||
// }
|
||||
// }
|
||||
|
||||
@ -155,27 +155,27 @@ void Foam::fileFormats::ensightMeshReader::setHandedness
|
||||
if (verts.size() == 8)
|
||||
{
|
||||
// Flipped hex
|
||||
Swap(verts[0], verts[4]);
|
||||
Swap(verts[1], verts[5]);
|
||||
Swap(verts[2], verts[6]);
|
||||
Swap(verts[3], verts[7]);
|
||||
std::swap(verts[0], verts[4]);
|
||||
std::swap(verts[1], verts[5]);
|
||||
std::swap(verts[2], verts[6]);
|
||||
std::swap(verts[3], verts[7]);
|
||||
}
|
||||
else if (verts.size() == 4)
|
||||
{
|
||||
// Flipped tet. Change orientation of base
|
||||
Swap(verts[0], verts[1]);
|
||||
std::swap(verts[0], verts[1]);
|
||||
}
|
||||
else if (verts.size() == 5)
|
||||
{
|
||||
// Flipped pyr. Change orientation of base
|
||||
Swap(verts[1], verts[3]);
|
||||
std::swap(verts[1], verts[3]);
|
||||
}
|
||||
else if (verts.size() == 6)
|
||||
{
|
||||
// Flipped prism.
|
||||
Swap(verts[0], verts[3]);
|
||||
Swap(verts[1], verts[4]);
|
||||
Swap(verts[2], verts[5]);
|
||||
std::swap(verts[0], verts[3]);
|
||||
std::swap(verts[1], verts[4]);
|
||||
std::swap(verts[2], verts[5]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user