Use lookup instead of find. NFC, just simpler.

llvm-svn: 323395
This commit is contained in:
Rafael Espindola 2018-01-25 01:29:15 +00:00
parent 7cff190839
commit 9e333e976e
1 changed files with 2 additions and 3 deletions

View File

@ -617,9 +617,8 @@ MemoryRegion *LinkerScript::findMemoryRegion(OutputSection *Sec) {
// If a memory region name was specified in the output section command,
// then try to find that region first.
if (!Sec->MemoryRegionName.empty()) {
auto It = MemoryRegions.find(Sec->MemoryRegionName);
if (It != MemoryRegions.end())
return It->second;
if (MemoryRegion *M = MemoryRegions.lookup(Sec->MemoryRegionName))
return M;
error("memory region '" + Sec->MemoryRegionName + "' not declared");
return nullptr;
}