[CodeHealth] Apply performance-move-const-arg (#26497)
This check has detected a few places where the use of `std::move` has been completely misleading. In one of them we are potentially incurring in a bug, as we are moving a shared callback that is being used in a loop. https://clang.llvm.org/extra/clang-tidy/checks/performance/move-const-arg.html Resolves https://github.com/brave/brave-browser/issues/42230
This commit is contained in:
@@ -51,7 +51,7 @@ void HttpsUpgradeExceptionsService::OnDATFileDataReady(
|
||||
}
|
||||
std::vector<std::string> lines = base::SplitString(
|
||||
contents, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
|
||||
for (const auto& line : lines) {
|
||||
for (auto&& line : lines) {
|
||||
exceptional_domains_.insert(std::move(line));
|
||||
}
|
||||
is_ready_ = true;
|
||||
|
||||
Reference in New Issue
Block a user