File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -149,20 +149,17 @@ struct DriverOptions {
149
149
this ->projectRootPath =
150
150
RootPath{AbsolutePath{std::move (cwd)}, RootKind::Project};
151
151
152
- if (llvm::sys::path::is_absolute (cliOpts.indexOutputPath )) {
153
- this ->indexOutputPath =
154
- AbsolutePath (std::string (cliOpts.indexOutputPath ));
155
- } else {
156
- this ->indexOutputPath = this ->projectRootPath .makeAbsolute (
157
- RootRelativePathRef (cliOpts.indexOutputPath , RootKind::Project));
158
- }
152
+ auto setAbsolutePath = [this ](const std::string &path, AbsolutePath &out) {
153
+ if (llvm::sys::path::is_absolute (path)) {
154
+ out = AbsolutePath (std::string (path));
155
+ return ;
156
+ }
157
+ out = this ->projectRootPath .makeAbsolute (
158
+ RootRelativePathRef (path, RootKind::Project));
159
+ };
159
160
160
- if (llvm::sys::path::is_absolute (cliOpts.compdbPath )) {
161
- this ->compdbPath = AbsolutePath (std::string (cliOpts.compdbPath ));
162
- } else {
163
- auto relPath = RootRelativePathRef (cliOpts.compdbPath , RootKind::Project);
164
- this ->compdbPath = this ->projectRootPath .makeAbsolute (relPath);
165
- }
161
+ setAbsolutePath (cliOpts.indexOutputPath , this ->indexOutputPath );
162
+ setAbsolutePath (cliOpts.compdbPath , this ->compdbPath );
166
163
167
164
auto makeDirs = [](const StdPath &path, const char *name) {
168
165
std::error_code error;
You can’t perform that action at this time.
0 commit comments