[llvm] r243863 - Use early return NFC.
Frederic Riss
friss at apple.com
Sun Aug 2 17:10:34 PDT 2015
Author: friss
Date: Sun Aug 2 19:10:33 2015
New Revision: 243863
URL: http://llvm.org/viewvc/llvm-project?rev=243863&view=rev
Log:
Use early return NFC.
Modified:
llvm/trunk/lib/Object/MachOUniversal.cpp
Modified: llvm/trunk/lib/Object/MachOUniversal.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/MachOUniversal.cpp?rev=243863&r1=243862&r2=243863&view=diff
==============================================================================
--- llvm/trunk/lib/Object/MachOUniversal.cpp (original)
+++ llvm/trunk/lib/Object/MachOUniversal.cpp Sun Aug 2 19:10:33 2015
@@ -69,14 +69,14 @@ MachOUniversalBinary::ObjectForArch::Obj
ErrorOr<std::unique_ptr<MachOObjectFile>>
MachOUniversalBinary::ObjectForArch::getAsObjectFile() const {
- if (Parent) {
- StringRef ParentData = Parent->getData();
- StringRef ObjectData = ParentData.substr(Header.offset, Header.size);
- StringRef ObjectName = Parent->getFileName();
- MemoryBufferRef ObjBuffer(ObjectData, ObjectName);
- return ObjectFile::createMachOObjectFile(ObjBuffer);
- }
- return object_error::parse_failed;
+ if (!Parent)
+ return object_error::parse_failed;
+
+ StringRef ParentData = Parent->getData();
+ StringRef ObjectData = ParentData.substr(Header.offset, Header.size);
+ StringRef ObjectName = Parent->getFileName();
+ MemoryBufferRef ObjBuffer(ObjectData, ObjectName);
+ return ObjectFile::createMachOObjectFile(ObjBuffer);
}
ErrorOr<std::unique_ptr<Archive>>
More information about the llvm-commits
mailing list