From 1b373f4999b64c4b56bf8ef4ce28e01da976ba19 Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Fri, 5 May 2017 14:07:23 +0000 Subject: [PATCH] [Tooling] Remove redundant check, NFCi Summary: The Database check looks redundant. Reviewers: bkramer Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D32909 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302236 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Tooling/JSONCompilationDatabase.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/Tooling/JSONCompilationDatabase.cpp b/lib/Tooling/JSONCompilationDatabase.cpp index 738e610ed9..f9a230eb63 100644 --- a/lib/Tooling/JSONCompilationDatabase.cpp +++ b/lib/Tooling/JSONCompilationDatabase.cpp @@ -146,12 +146,8 @@ class JSONCompilationDatabasePlugin : public CompilationDatabasePlugin { loadFromDirectory(StringRef Directory, std::string &ErrorMessage) override { SmallString<1024> JSONDatabasePath(Directory); llvm::sys::path::append(JSONDatabasePath, "compile_commands.json"); - std::unique_ptr Database( - JSONCompilationDatabase::loadFromFile( - JSONDatabasePath, ErrorMessage, JSONCommandLineSyntax::AutoDetect)); - if (!Database) - return nullptr; - return Database; + return JSONCompilationDatabase::loadFromFile( + JSONDatabasePath, ErrorMessage, JSONCommandLineSyntax::AutoDetect); } }; -- 2.40.0