Skip to content

Commit c21fd44

Browse files
authored
[clang][deps][NFC] Replace a vector with an array (#169555)
`ResourceDirectoryCache::findResourceDir` uses a `std::vector` when a `std::array` would do.
1 parent e07e60e commit c21fd44

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

clang/tools/clang-scan-deps/ClangScanDeps.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,9 @@ class ResourceDirectoryCache {
284284
if (CachedResourceDir != Cache.end())
285285
return CachedResourceDir->second;
286286

287-
std::vector<StringRef> PrintResourceDirArgs{ClangBinaryName};
288-
if (ClangCLMode)
289-
PrintResourceDirArgs.push_back("/clang:-print-resource-dir");
290-
else
291-
PrintResourceDirArgs.push_back("-print-resource-dir");
287+
const std::array<StringRef, 2> PrintResourceDirArgs{
288+
ClangBinaryName,
289+
ClangCLMode ? "/clang:-print-resource-dir" : "-print-resource-dir"};
292290

293291
llvm::SmallString<64> OutputFile, ErrorFile;
294292
llvm::sys::fs::createTemporaryFile("print-resource-dir-output",

0 commit comments

Comments
 (0)