Commit cce611cd authored by George Burgess IV's avatar George Burgess IV Committed by Commit Bot

fix an instance of bugprone-move-forwarding-reference

Unless it's guaranteed that `std::forward` always turns into an rvalue
ref, using `std::move(x)`, where `x`'s type is a universal reference, is
generally unsafe. `std::forward` is preferred for these cases.

Bug: 1134310
Change-Id: I834deb0fe22dea2c9907f8596a5f32ae8810e10f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2443245
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Auto-Submit: George Burgess <gbiv@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813135}
parent e7724e2e
...@@ -344,7 +344,7 @@ void StatusIconLinuxDbus::OnOwnership(const std::string& service_name, ...@@ -344,7 +344,7 @@ void StatusIconLinuxDbus::OnOwnership(const std::string& service_name,
properties_->RegisterInterface(kInterfaceStatusNotifierItem); properties_->RegisterInterface(kInterfaceStatusNotifierItem);
auto set_property = [&](const std::string& property_name, auto&& value) { auto set_property = [&](const std::string& property_name, auto&& value) {
properties_->SetProperty(kInterfaceStatusNotifierItem, property_name, properties_->SetProperty(kInterfaceStatusNotifierItem, property_name,
std::move(value), false); std::forward<decltype(value)>(value), false);
}; };
set_property(kPropertyItemIsMenu, DbusBoolean(false)); set_property(kPropertyItemIsMenu, DbusBoolean(false));
set_property(kPropertyWindowId, DbusInt32(0)); set_property(kPropertyWindowId, DbusInt32(0));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment