Commit cf4f9110 authored by Dave Moxey's avatar Dave Moxey Committed by Douglas Serson

Switch map from linear search to lookup

(cherry picked from commit 0d7bfd44)
parent 9144ecd4
......@@ -2325,19 +2325,14 @@ namespace Nektar
ExpansionShPtr MeshGraph::GetExpansion(GeometrySharedPtr geom, const std::string variable)
{
ExpansionMapIter iter;
ExpansionShPtr returnval;
ExpansionMapShPtr expansionMap = m_expansionMapShPtrMap.find(variable)->second;
for (iter = expansionMap->begin(); iter!=expansionMap->end(); ++iter)
{
if ((iter->second)->m_geomShPtr == geom)
{
returnval = iter->second;
break;
}
}
return returnval;
iter = expansionMap->find(geom->GetGlobalID());
ASSERTL1(iter != expansionMap.end(),
"Could not find expansion " +
boost::lexical_cast<string>(geom->GetGlobalID()) +
" in expansion for variable " + variable);
return iter->second;
}
......
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