STYLE: avoid explicit use of 'word' as HashTable template parameter

- less clutter and typing to use the default template parameter when
  the key is 'word' anyhow.

- use EdgeMap instead of the longhand HashTable version where
  appropriate
This commit is contained in:
Mark Olesen
2017-05-10 13:44:27 +02:00
parent 4d126bfe2d
commit 8728e8353f
14 changed files with 87 additions and 110 deletions

View File

@ -424,13 +424,13 @@ Foam::face Foam::meshCutter::addEdgeCutsToFace(const label facei) const
// Check if edge has been cut.
label fp1 = f.fcIndex(fp);
HashTable<label, edge, Hash<edge>>::const_iterator fnd =
EdgeMap<label>::const_iterator fnd =
addedPoints_.find(edge(f[fp], f[fp1]));
if (fnd != addedPoints_.end())
if (fnd.found())
{
// edge has been cut. Introduce new vertex.
newFace[newFp++] = fnd();
newFace[newFp++] = fnd.object();
}
}
@ -483,12 +483,12 @@ Foam::face Foam::meshCutter::loopToFace
if (edgeI != -1)
{
// Existing edge. Insert split-edge point if any.
HashTable<label, edge, Hash<edge>>::const_iterator fnd =
EdgeMap<label>::const_iterator fnd =
addedPoints_.find(mesh().edges()[edgeI]);
if (fnd != addedPoints_.end())
if (fnd.found())
{
newFace[newFacei++] = fnd();
newFace[newFacei++] = fnd.object();
}
}
}
@ -1043,24 +1043,17 @@ void Foam::meshCutter::updateMesh(const mapPolyMesh& morphMap)
}
{
HashTable<label, edge, Hash<edge>> newAddedPoints(addedPoints_.size());
EdgeMap<label> newAddedPoints(addedPoints_.size());
for
(
HashTable<label, edge, Hash<edge>>::const_iterator iter =
addedPoints_.begin();
iter != addedPoints_.end();
++iter
)
forAllConstIters(addedPoints_, iter)
{
const edge& e = iter.key();
const label addedPointi = iter.object();
label newStart = morphMap.reversePointMap()[e.start()];
label newEnd = morphMap.reversePointMap()[e.end()];
label addedPointi = iter();
label newAddedPointi = morphMap.reversePointMap()[addedPointi];
if ((newStart >= 0) && (newEnd >= 0) && (newAddedPointi >= 0))