projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0c01b37
)
[clangd][NFC] Reserve storage when creating semantic token encoding.
author
Nathan James
<n.james93@hotmail.co.uk>
Wed, 28 Apr 2021 21:39:54 +0000
(22:39 +0100)
committer
Nathan James
<n.james93@hotmail.co.uk>
Wed, 28 Apr 2021 21:39:54 +0000
(22:39 +0100)
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D101461
clang-tools-extra/clangd/Protocol.cpp
patch
|
blob
|
history
diff --git
a/clang-tools-extra/clangd/Protocol.cpp
b/clang-tools-extra/clangd/Protocol.cpp
index
5432392
..
71a89cc
100644
(file)
--- a/
clang-tools-extra/clangd/Protocol.cpp
+++ b/
clang-tools-extra/clangd/Protocol.cpp
@@
-1075,6
+1075,7
@@
llvm::json::Value toJSON(const FileStatus &FStatus) {
constexpr unsigned SemanticTokenEncodingSize = 5;
static llvm::json::Value encodeTokens(llvm::ArrayRef<SemanticToken> Toks) {
llvm::json::Array Result;
+ Result.reserve(SemanticTokenEncodingSize * Toks.size());
for (const auto &Tok : Toks) {
Result.push_back(Tok.deltaLine);
Result.push_back(Tok.deltaStart);