summaryrefslogtreecommitdiffstats
path: root/clangd/index/FileIndex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clangd/index/FileIndex.cpp')
-rw-r--r--clangd/index/FileIndex.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clangd/index/FileIndex.cpp b/clangd/index/FileIndex.cpp
index ed2500ee..cc8487ac 100644
--- a/clangd/index/FileIndex.cpp
+++ b/clangd/index/FileIndex.cpp
@@ -37,7 +37,7 @@ void FileSymbols::update(PathRef Path, std::unique_ptr<SymbolSlab> Slab) {
if (!Slab)
FileToSlabs.erase(Path);
else
- FileToSlabs[Path] = std::shared_ptr<SymbolSlab>(Slab.release());
+ FileToSlabs[Path] = std::move(Slab);
}
std::shared_ptr<std::vector<const Symbol *>> FileSymbols::allSymbols() {
@@ -74,9 +74,10 @@ void FileIndex::update(const Context &Ctx, PathRef Path, ParsedAST *AST) {
Index.build(std::move(Symbols));
}
-bool FileIndex::fuzzyFind(const Context &Ctx, const FuzzyFindRequest &Req,
- std::function<void(const Symbol &)> Callback) const {
- return Index.fuzzyFind(Ctx, Req, std::move(Callback));
+bool FileIndex::fuzzyFind(
+ const Context &Ctx, const FuzzyFindRequest &Req,
+ llvm::function_ref<void(const Symbol &)> Callback) const {
+ return Index.fuzzyFind(Ctx, Req, Callback);
}
} // namespace clangd