Commit f3c6a31d 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: Ic4d2f59b00c371db343bb1b698cb787d70871b66
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2443513Reviewed-by: default avatarRyo Hashimoto <hashimoto@chromium.org>
Commit-Queue: George Burgess <gbiv@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815221}
parent a7a5280e
......@@ -36,7 +36,7 @@ class COMPONENT_EXPORT(DBUS) DbusProperties {
auto interface_it = properties_.find(interface);
DCHECK(interface_it != properties_.end());
auto property_it = interface_it->second.find(name);
DbusVariant new_value = MakeDbusVariant(std::move(value));
DbusVariant new_value = MakeDbusVariant(std::forward<T>(value));
const bool send_signal =
emit_signal && (property_it == interface_it->second.end() ||
property_it->second != new_value);
......
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