Commit b0587ddd 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: I9f00c6bf7dff033191adf75a9943a0e9cb139b1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2443730
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Auto-Submit: George Burgess <gbiv@chromium.org>
Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812953}
parent 07bb6265
...@@ -167,7 +167,7 @@ DbusMenu::DbusMenu(dbus::ExportedObject* exported_object, ...@@ -167,7 +167,7 @@ DbusMenu::DbusMenu(dbus::ExportedObject* exported_object,
properties_->RegisterInterface(kInterfaceDbusMenu); properties_->RegisterInterface(kInterfaceDbusMenu);
auto set_property = [&](const std::string& property_name, auto&& value) { auto set_property = [&](const std::string& property_name, auto&& value) {
properties_->SetProperty(kInterfaceDbusMenu, property_name, properties_->SetProperty(kInterfaceDbusMenu, property_name,
std::move(value), false); std::forward<decltype(value)>(value), false);
}; };
set_property(kPropertyIconThemePath, DbusArray<DbusString>()); set_property(kPropertyIconThemePath, DbusArray<DbusString>());
set_property(kPropertyMenuStatus, DbusString(kPropertyValueStatusNormal)); set_property(kPropertyMenuStatus, DbusString(kPropertyValueStatusNormal));
......
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