Skip to content

Commit cce4abe

Browse files
committed
StringRef by value
1 parent 3ea2689 commit cce4abe

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

clang-tools-extra/clangd/HeaderSourceSwitch.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,11 @@ std::optional<Path> getCorrespondingHeaderOrSource(PathRef OriginalFile,
9292
// For each symbol in the original file, we get its target location (decl or
9393
// def) from the index, then award that target file.
9494
#ifdef CLANGD_PATH_CASE_INSENSITIVE
95-
auto pathEqual = [](const llvm::StringRef &l, const llvm::StringRef &r) {
95+
auto pathEqual = [](llvm::StringRef l, llvm::StringRef r) {
9696
return l.equals_insensitive(r);
9797
};
9898
#else
99-
auto pathEqual = [](const llvm::StringRef &l, const llvm::StringRef &r) {
100-
return l == r;
101-
};
99+
auto pathEqual = [](llvm::StringRef l, llvm::StringRef r) { return l == r; };
102100
#endif
103101
Index->lookup(Request, [&](const Symbol &Sym) {
104102
auto TargetPathDefinition =

0 commit comments

Comments
 (0)