Bug 1551083 - Fix a bugprone-move-forwarding-reference defect in ProfileBufferEntry r=erahm
authorSylvestre Ledru <sledru@mozilla.com>
Tue, 14 May 2019 07:12:19 +0000
changeset 532567 a15e072aac3f4e1fbfc78a9931c0290fba2d09cd
parent 532566 a7876eccb629963d1d81aef9a30c569cf61c77d5
child 532568 a928c7e7995bccca093bc5809ae53a007d9d04a3
push id11270
push userrgurzau@mozilla.com
push dateWed, 15 May 2019 15:07:19 +0000
treeherdermozilla-beta@571bc76da583 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerserahm
bugs1551083
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1551083 - Fix a bugprone-move-forwarding-reference defect in ProfileBufferEntry r=erahm Depends on D30816 Differential Revision: https://phabricator.services.mozilla.com/D30817
tools/profiler/core/ProfileBufferEntry.cpp
--- a/tools/profiler/core/ProfileBufferEntry.cpp
+++ b/tools/profiler/core/ProfileBufferEntry.cpp
@@ -153,17 +153,17 @@ class ForEachTrackedOptimizationTypeInfo
   nsTArray<TypeInfo> mTypesetForUpcomingEntry;
   LambdaT mLambda;
 };
 
 template <typename LambdaT>
 ForEachTrackedOptimizationTypeInfoLambdaOp<LambdaT>
 MakeForEachTrackedOptimizationTypeInfoLambdaOp(LambdaT&& aLambda) {
   return ForEachTrackedOptimizationTypeInfoLambdaOp<LambdaT>(
-      std::move(aLambda));
+      std::forward<LambdaT>(aLambda));
 }
 
 // As mentioned in ProfileBufferEntry.h, the JSON format contains many
 // arrays whose elements are laid out according to various schemas to help
 // de-duplication. This RAII class helps write these arrays by keeping track of
 // the last non-null element written and adding the appropriate number of null
 // elements when writing new non-null elements. It also automatically opens and
 // closes an array element on the given JSON writer.