[lld] r249128 - Simplify. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 06:23:29 PDT 2015


Author: rafael
Date: Fri Oct  2 08:23:29 2015
New Revision: 249128

URL: http://llvm.org/viewvc/llvm-project?rev=249128&view=rev
Log:
Simplify. NFC.

Modified:
    lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp

Modified: lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp?rev=249128&r1=249127&r2=249128&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp (original)
+++ lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp Fri Oct  2 08:23:29 2015
@@ -1294,8 +1294,8 @@ public:
   YAMLReader(const Registry &registry) : _registry(registry) {}
 
   bool canParse(file_magic magic, MemoryBufferRef mb) const override {
-    StringRef ext = llvm::sys::path::extension(mb.getBufferIdentifier());
-    return ext.equals(".objtxt") || ext.equals(".yaml");
+    StringRef name = mb.getBufferIdentifier();
+    return name.endswith(".objtxt") || name.endswith(".yaml");
   }
 
   ErrorOr<std::unique_ptr<File>>




More information about the llvm-commits mailing list