[PATCH] D64475: [clangd] Duplicate lines of semantic highlightings sent removed.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 31 01:43:17 PDT 2019
hokein added inline comments.
Comment at: clang-tools-extra/clangd/ClangdLSPServer.cpp:1125
+ Old = std::move(FileToHighlightings[File]);
+ FileToHighlightings[File] = Highlightings;
> NIT: avoid copying (from `Highlightings` into the map) under a lock, make the copy outside the lock instead
I think we can even avoid copy, since we only use the `Highlightings` for calculating the diff.
Old = std::move(FileToHighlightings[File]);
// calculate the diff.
FileToHighlightings[File] = std::move(Highlightings);
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits