Commit 2aa13057 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: I0c245a9c52d9dd582ba1e0e14d0dac81e2fc4ea0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2443755
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Auto-Submit: George Burgess <gbiv@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813211}
parent 044d5382
...@@ -47,7 +47,7 @@ MojoResult CreateSharedBufferFromRegion(T&& region, MojoHandle* handle) { ...@@ -47,7 +47,7 @@ MojoResult CreateSharedBufferFromRegion(T&& region, MojoHandle* handle) {
scoped_refptr<SharedBufferDispatcher> buffer; scoped_refptr<SharedBufferDispatcher> buffer;
MojoResult result = MojoResult result =
SharedBufferDispatcher::CreateFromPlatformSharedMemoryRegion( SharedBufferDispatcher::CreateFromPlatformSharedMemoryRegion(
T::TakeHandleForSerialization(std::move(region)), &buffer); T::TakeHandleForSerialization(std::forward<T>(region)), &buffer);
if (result != MOJO_RESULT_OK) if (result != MOJO_RESULT_OK)
return result; return result;
......
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