Commit 10b888bd authored by Pavel Vainerman's avatar Pavel Vainerman

Перенёс оптимизацию для ObjectIndex_idXML.h из 2.0, очень уж актуально.

parent a8acd5bf
......@@ -225,12 +225,9 @@ const ObjectInfo* ObjectIndex_idXML::getObjectInfo( const ObjectId id )
// ------------------------------------------------------------------------------------------
const ObjectInfo* ObjectIndex_idXML::getObjectInfo( const std::string& name )
{
const char* n = name.c_str();
for( MapObjects::iterator it=omap.begin(); it!=omap.end(); ++it )
{
if( !strcmp(it->second.repName,n) )
return &(it->second);
}
MapObjectKey::iterator it = mok.find(name);
if( it != mok.end() )
return getObjectInfo(it->second);
return NULL;
}
......
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