Skip to content

Commit babbc6f

Browse files
authored
[NFC] Fixes proposed by code sanitizer. (#134138)
1 parent a2e888f commit babbc6f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clang-tools-extra/clangd/ConfigCompile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ struct FragmentCompiler {
535535
}
536536
if (Filters->empty())
537537
return std::nullopt;
538-
auto Filter = [Filters](llvm::StringRef Path) {
538+
auto Filter = [Filters = std::move(Filters)](llvm::StringRef Path) {
539539
for (auto &Regex : *Filters)
540540
if (Regex.match(Path))
541541
return true;

clang-tools-extra/clangd/Headers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,14 +305,14 @@ IncludeInserter::calculateIncludePath(const HeaderFile &InsertedHeader,
305305
if (llvm::sys::path::is_absolute(Suggested))
306306
return std::nullopt;
307307
bool IsAngled = false;
308-
for (auto Filter : AngledHeaders) {
308+
for (auto &Filter : AngledHeaders) {
309309
if (Filter(Suggested)) {
310310
IsAngled = true;
311311
break;
312312
}
313313
}
314314
bool IsQuoted = false;
315-
for (auto Filter : QuotedHeaders) {
315+
for (auto &Filter : QuotedHeaders) {
316316
if (Filter(Suggested)) {
317317
IsQuoted = true;
318318
break;

0 commit comments

Comments
 (0)