mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: for-range, forAllIters() ... in applications/utilities
- reduced clutter when iterating over containers
This commit is contained in:
@ -261,10 +261,10 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
||||
}
|
||||
|
||||
// 2. Does sparseData contain more?
|
||||
forAllConstIter(Map<point>, sparseData, iter)
|
||||
forAllConstIters(sparseData, iter)
|
||||
{
|
||||
const point& sparsePt = iter();
|
||||
label meshPointi = iter.key();
|
||||
const label meshPointi = iter.key();
|
||||
const point& sparsePt = iter.val();
|
||||
const point& fullPt = fullData[meshPointi];
|
||||
|
||||
if (fullPt != sparsePt)
|
||||
@ -350,9 +350,9 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
||||
{
|
||||
const edge& e = mesh.edges()[meshEdgeI];
|
||||
|
||||
EdgeMap<point>::const_iterator iter = sparseData.find(e);
|
||||
const auto iter = sparseData.cfind(e);
|
||||
|
||||
if (iter != sparseData.end())
|
||||
if (iter.found())
|
||||
{
|
||||
const point& sparsePt = iter();
|
||||
const point& fullPt = fullData[meshEdgeI];
|
||||
|
||||
Reference in New Issue
Block a user