Fix non-compliant rvalue ref code in mac/update_service_proxy_test.mm.
This CL fixes two minor coding style issues. https://google.github.io/styleguide/cppguide.html#Rvalue_references According to the coding style, rvalue refs can only be used in a couple of scenarios, and they do not include the following: 1. base::OnceClosure&& done_cb The idiomatic way is to declare base::OnceClosure function parameters by value. 2. StateChangeTestEngine::StateChangeTestEngine( std::vector<StatePair>&& state_vec) : state_seq_(state_vec) {} This ctor is not one of the cases where overloads on rvalue ref are allowed. Also, the code on trunk has a minor bug: because move semantics are not passed through, std::move needs to be called even though `state_vec` is a rvalue reference. Otherwise, the member initialization is still going to be a copy instead of a move. Bug: 1164718 Change-Id: I3d63cb6bb837121e640381ce1ff0ae96ce08d161 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2619964Reviewed-by:Joshua Pawlicki <waffles@chromium.org> Commit-Queue: Sorin Jianu <sorin@chromium.org> Cr-Commit-Position: refs/heads/master@{#843696}
Showing
Please register or sign in to comment