[NFC] Fixes proposed by code sanitizer. (#134138)
This commit is contained in:
committed by
GitHub
parent
a2e888f5b4
commit
babbc6f842
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user