Commit 77ff60fb authored by Cédric Traizet's avatar Cédric Traizet

PERF : NeigboursMapType is now an unordered_map instead of a map

parent 62920617
......@@ -71,7 +71,7 @@ public:
typedef itk::VariableLengthVector<double> RealVectorPixelType;
typedef std::map<InputLabelType, std::set<InputLabelType> > NeigboursMapType;
typedef std::unordered_map<InputLabelType, std::set<InputLabelType> > NeigboursMapType;
typedef std::unordered_map<InputLabelType , RealVectorPixelType > LabelStatisticType;
typedef std::unordered_map<InputLabelType , double> LabelPopulationType;
......
......@@ -54,9 +54,9 @@ PersistentLabelImageSmallRegionMergingFilter< TInputLabelImage >
// Merge the neighbours maps from all threads
for( unsigned int threadId = 0; threadId < this->GetNumberOfThreads(); threadId++)
{
for (auto it = m_NeighboursMapsTmp[threadId].begin(); it != m_NeighboursMapsTmp[threadId].end(); it++)
for (auto const & neighbours : m_NeighboursMapsTmp[threadId])
{
neighboursMap[ it->first ].insert( it->second.begin(), it->second.end() );
neighboursMap[ neighbours.first ].insert( neighbours.second.begin(), neighbours.second.end() );
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment