mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-07-17 19:56:38 -04:00
definition optimized .
This commit is contained in:
parent
a2a5f867b5
commit
a4e03c3f6e
2 changed files with 7 additions and 4 deletions
|
@ -3814,10 +3814,13 @@ void CMapData::UpdateTreeInfo(const CString* lpTreeType)
|
|||
}
|
||||
}
|
||||
|
||||
int CMapData::GetBuildingID(LPCSTR lpBuildingName)
|
||||
int CMapData::GetBuildingID(const CString& lpBuildingName)
|
||||
{
|
||||
if (buildingid.find(lpBuildingName) == buildingid.end()) return -1;
|
||||
return buildingid[lpBuildingName];
|
||||
auto const it = buildingid.find(lpBuildingName);
|
||||
if (it == buildingid.end()) {
|
||||
return -1;
|
||||
}
|
||||
return it->second;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue