[NFC] Fixes proposed by code sanitizer. (#134138)

This commit is contained in:
Zahira Ammarguellat
2025-04-04 05:04:16 -07:00
committed by GitHub
parent a2e888f5b4
commit babbc6f842
2 changed files with 3 additions and 3 deletions

View File

@@ -535,7 +535,7 @@ struct FragmentCompiler {
}
if (Filters->empty())
return std::nullopt;
auto Filter = [Filters](llvm::StringRef Path) {
auto Filter = [Filters = std::move(Filters)](llvm::StringRef Path) {
for (auto &Regex : *Filters)
if (Regex.match(Path))
return true;

View File

@@ -305,14 +305,14 @@ IncludeInserter::calculateIncludePath(const HeaderFile &InsertedHeader,
if (llvm::sys::path::is_absolute(Suggested))
return std::nullopt;
bool IsAngled = false;
for (auto Filter : AngledHeaders) {
for (auto &Filter : AngledHeaders) {
if (Filter(Suggested)) {
IsAngled = true;
break;
}
}
bool IsQuoted = false;
for (auto Filter : QuotedHeaders) {
for (auto &Filter : QuotedHeaders) {
if (Filter(Suggested)) {
IsQuoted = true;
break;