r209993 - Don't compare an error_code with nullptr.

Rafael Espindola rafael.espindola at gmail.com
Sun Jun 1 09:16:02 PDT 2014


Author: rafael
Date: Sun Jun  1 11:16:02 2014
New Revision: 209993

URL: http://llvm.org/viewvc/llvm-project?rev=209993&view=rev
Log:
Don't compare an error_code with nullptr.

Modified:
    cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp

Modified: cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp?rev=209993&r1=209992&r2=209993&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp (original)
+++ cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp Sun Jun  1 11:16:02 2014
@@ -147,7 +147,7 @@ JSONCompilationDatabase::loadFromFile(St
   std::unique_ptr<llvm::MemoryBuffer> DatabaseBuffer;
   llvm::error_code Result =
     llvm::MemoryBuffer::getFile(FilePath, DatabaseBuffer);
-  if (Result != nullptr) {
+  if (Result) {
     ErrorMessage = "Error while opening JSON database: " + Result.message();
     return nullptr;
   }





More information about the cfe-commits mailing list