From de242f310b7f27fd09cfc44e4b7c7f9420b7fa8c Mon Sep 17 00:00:00 2001 From: eidheim Date: Tue, 5 Jul 2022 13:01:44 +0200 Subject: [PATCH] Minor cleanup of CMake::get_executable --- src/cmake.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cmake.cpp b/src/cmake.cpp index 793eadb..06efaf2 100644 --- a/src/cmake.cpp +++ b/src/cmake.cpp @@ -149,8 +149,7 @@ bool CMake::update_debug_build(const boost::filesystem::path &debug_build_path, boost::filesystem::path CMake::get_executable(const boost::filesystem::path &build_path, const boost::filesystem::path &file_path) { // Prefer the CMake file API (if available) which gives exact information about the targets a file belongs to - auto executable = get_executable_from_file_api(build_path, file_path); - if(executable) + if(auto executable = get_executable_from_file_api(build_path, file_path)) return *executable; // CMake does not store in compile_commands.json if an object is part of an executable or not.