From 50a967d601749beceaaf901b5931fa0a96fb17df Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 28 Dec 2017 14:47:01 +0000 Subject: [clangd] Simplify code. No functionality change intended. llvm-svn: 321523 --- clang-tools-extra/clangd/index/FileIndex.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'clang-tools-extra/clangd/index/FileIndex.cpp') diff --git a/clang-tools-extra/clangd/index/FileIndex.cpp b/clang-tools-extra/clangd/index/FileIndex.cpp index ed2500eed9f..cc8487ac5d5 100644 --- a/clang-tools-extra/clangd/index/FileIndex.cpp +++ b/clang-tools-extra/clangd/index/FileIndex.cpp @@ -37,7 +37,7 @@ void FileSymbols::update(PathRef Path, std::unique_ptr Slab) { if (!Slab) FileToSlabs.erase(Path); else - FileToSlabs[Path] = std::shared_ptr(Slab.release()); + FileToSlabs[Path] = std::move(Slab); } std::shared_ptr> 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 Callback) const { - return Index.fuzzyFind(Ctx, Req, std::move(Callback)); +bool FileIndex::fuzzyFind( + const Context &Ctx, const FuzzyFindRequest &Req, + llvm::function_ref Callback) const { + return Index.fuzzyFind(Ctx, Req, Callback); } } // namespace clangd -- cgit v1.2.3