https://github.com/davidstone created 
https://github.com/llvm/llvm-project/pull/169555

`ResourceDirectoryCache::findResourceDir` uses a `std::vector` when a 
`std::array` would do.

>From b2619be6151a67dda1bd8f6cd3e7f3c29ab2c0e4 Mon Sep 17 00:00:00 2001
From: David Stone <[email protected]>
Date: Wed, 3 May 2023 16:07:30 -0600
Subject: [PATCH] [clang][deps][NFC] Replace a vector with an array

`ResourceDirectoryCache::findResourceDir` uses a `std::vector` when a 
`std::array` would do.
---
 clang/tools/clang-scan-deps/ClangScanDeps.cpp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/clang/tools/clang-scan-deps/ClangScanDeps.cpp 
b/clang/tools/clang-scan-deps/ClangScanDeps.cpp
index 5f5bf42df5e6b..3efa28b0469c1 100644
--- a/clang/tools/clang-scan-deps/ClangScanDeps.cpp
+++ b/clang/tools/clang-scan-deps/ClangScanDeps.cpp
@@ -284,11 +284,9 @@ class ResourceDirectoryCache {
     if (CachedResourceDir != Cache.end())
       return CachedResourceDir->second;
 
-    std::vector<StringRef> PrintResourceDirArgs{ClangBinaryName};
-    if (ClangCLMode)
-      PrintResourceDirArgs.push_back("/clang:-print-resource-dir");
-    else
-      PrintResourceDirArgs.push_back("-print-resource-dir");
+    const std::array<StringRef, 2> PrintResourceDirArgs{
+        ClangBinaryName,
+        ClangCLMode ? "/clang:-print-resource-dir" : "-print-resource-dir"};
 
     llvm::SmallString<64> OutputFile, ErrorFile;
     llvm::sys::fs::createTemporaryFile("print-resource-dir-output",

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to