mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: avoid xfer on simple data types
- in many places can use move construcors or rely on RVO
This commit is contained in:
@ -172,7 +172,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::calcRegionSplit
|
||||
{
|
||||
offsets[i] = mesh().nFaces();
|
||||
}
|
||||
const globalIndex globalRegions(offsets.xfer());
|
||||
const globalIndex globalRegions(std::move(offsets));
|
||||
|
||||
// Minimise regions across connected cells
|
||||
// Note: still uses global decisions so all processors are running
|
||||
@ -215,7 +215,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::calcRegionSplit
|
||||
compactOffsets[i] = globalToCompact.size();
|
||||
}
|
||||
|
||||
return autoPtr<globalIndex>(new globalIndex(compactOffsets.xfer()));
|
||||
return autoPtr<globalIndex>(new globalIndex(std::move(compactOffsets)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -285,7 +285,7 @@ Foam::searchableSurfaceCollection::~searchableSurfaceCollection()
|
||||
|
||||
const Foam::wordList& Foam::searchableSurfaceCollection::regions() const
|
||||
{
|
||||
if (regions_.size() == 0)
|
||||
if (regions_.empty())
|
||||
{
|
||||
regionOffset_.setSize(subGeom_.size());
|
||||
|
||||
@ -309,7 +309,7 @@ const Foam::wordList& Foam::searchableSurfaceCollection::regions() const
|
||||
}
|
||||
}
|
||||
}
|
||||
regions_.transfer(allRegions.shrink());
|
||||
regions_.transfer(allRegions);
|
||||
}
|
||||
return regions_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user