diff options
author | Tim Jenssen <Tim.Jenssen@qt.io> | 2019-10-25 19:48:14 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2019-11-12 12:22:15 +0000 |
commit | 0be200e44e44217e5e21f6358654306dcf200e71 (patch) | |
tree | 683ee55509bcca5e07a22162ca5dad5b601800d2 /src/plugins/clangcodemodel/clangutils.cpp | |
parent | 8866153c2a1f65d6ae37b4c8914b66356fbdd58e (diff) | |
download | qt-creator-0be200e44e44217e5e21f6358654306dcf200e71.tar.gz |
improve code
Change-Id: I06c7274c39f7e369d4cd9bed0c1ef77e4bc08b35
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/clangcodemodel/clangutils.cpp')
-rw-r--r-- | src/plugins/clangcodemodel/clangutils.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/plugins/clangcodemodel/clangutils.cpp b/src/plugins/clangcodemodel/clangutils.cpp index e7d7de420a..2734f23255 100644 --- a/src/plugins/clangcodemodel/clangutils.cpp +++ b/src/plugins/clangcodemodel/clangutils.cpp @@ -315,15 +315,11 @@ static ::Utils::FilePath compilerPath(const CppTools::ProjectPart &projectPart) static ::Utils::FilePath buildDirectory(const ProjectExplorer::Project &project) { - ProjectExplorer::Target *target = project.activeTarget(); - if (!target) - return ::Utils::FilePath(); - - ProjectExplorer::BuildConfiguration *buildConfig = target->activeBuildConfiguration(); - if (!buildConfig) - return ::Utils::FilePath(); - - return buildConfig->buildDirectory(); + if (auto *target = project.activeTarget()) { + if (auto *bc = target->activeBuildConfiguration()) + return bc->buildDirectory(); + } + return {}; } static QStringList projectPartArguments(const ProjectPart &projectPart) |