forked from OSchip/llvm-project
[clangd][NFC] Reserve storage when creating semantic token encoding.
Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D101461
This commit is contained in:
parent
0c01b37eeb
commit
c3846bcfe1
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue