[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:
cdesouza-chromium
2024-11-12 12:08:03 -05:00
committed by GitHub
parent d0becfcd17
commit 4ffbda2340
9 changed files with 13 additions and 14 deletions
@@ -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;