Commit 22575234 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: I09a45cc9ea6378102e1e6227894e4096706f023b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2441382Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Commit-Queue: George Burgess <gbiv@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814805}
parent a37ae081
......@@ -375,7 +375,7 @@ class COMPONENT_EXPORT(DBUS) DbusDictEntry
template <typename K, typename V>
auto MakeDbusDictEntry(K&& k, V&& v) {
return DbusDictEntry<K, V>(std::move(k), std::move(v));
return DbusDictEntry<K, V>(std::forward<K>(k), std::forward<V>(v));
}
// A convenience class for DbusArray<DbusDictEntry<DbusString, DbusVariant>>,
......
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