diff --git a/lib/IR/Type.cpp b/lib/IR/Type.cpp index 46c61fc06e6..432cbc99f5e 100644 --- a/lib/IR/Type.cpp +++ b/lib/IR/Type.cpp @@ -616,11 +616,7 @@ bool StructType::isLayoutIdentical(StructType *Other) const { /// getTypeByName - Return the type with the specified name, or null if there /// is none by that name. StructType *Module::getTypeByName(StringRef Name) const { - StringMap::iterator I = - getContext().pImpl->NamedStructTypes.find(Name); - if (I != getContext().pImpl->NamedStructTypes.end()) - return I->second; - return 0; + return getContext().pImpl->NamedStructTypes.lookup(Name); }