From 08274d7d5db7c4dddc271b84239a01cd116e42b8 Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Wed, 3 Feb 2021 08:30:45 +0100 Subject: [PATCH] [clang-include-fixer] Pre-reserve vector size. NFC --- clang-tools-extra/clang-include-fixer/SymbolIndexManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/clang-tools-extra/clang-include-fixer/SymbolIndexManager.cpp b/clang-tools-extra/clang-include-fixer/SymbolIndexManager.cpp index 97015f2..cbd79b64 100644 --- a/clang-tools-extra/clang-include-fixer/SymbolIndexManager.cpp +++ b/clang-tools-extra/clang-include-fixer/SymbolIndexManager.cpp @@ -149,6 +149,7 @@ SymbolIndexManager::search(llvm::StringRef Identifier, rank(MatchedSymbols, FileName); // Strip signals, they are no longer needed. std::vector Res; + Res.reserve(MatchedSymbols.size()); for (auto &SymAndSig : MatchedSymbols) Res.push_back(std::move(SymAndSig.Symbol)); return Res; -- 2.7.4