File tree Expand file tree Collapse file tree 4 files changed +10
-11
lines changed
ReactCommon/react/renderer/mounting Expand file tree Collapse file tree 4 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -33,15 +33,15 @@ SurfaceId MountingCoordinator::getSurfaceId() const {
3333 return surfaceId_;
3434}
3535
36- void MountingCoordinator::push (ShadowTreeRevision const & revision) const {
36+ void MountingCoordinator::push (ShadowTreeRevision revision) const {
3737 {
3838 std::lock_guard<std::mutex> lock (mutex_);
3939
4040 react_native_assert (
4141 !lastRevision_.has_value () || revision.number != lastRevision_->number );
4242
4343 if (!lastRevision_.has_value () || lastRevision_->number < revision.number ) {
44- lastRevision_ = revision;
44+ lastRevision_ = std::move ( revision) ;
4545 }
4646 }
4747
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ class MountingCoordinator final {
8888 private:
8989 friend class ShadowTree ;
9090
91- void push (ShadowTreeRevision const & revision) const ;
91+ void push (ShadowTreeRevision revision) const ;
9292
9393 /*
9494 * Revokes the last pushed `ShadowTreeRevision`.
Original file line number Diff line number Diff line change @@ -393,16 +393,16 @@ CommitStatus ShadowTree::tryCommit(
393393 telemetry.didCommit ();
394394 telemetry.setRevisionNumber (static_cast <int >(newRevisionNumber));
395395
396- newRevision =
397- ShadowTreeRevision{ newRootShadowNode, newRevisionNumber, telemetry};
396+ newRevision = ShadowTreeRevision{
397+ std::move ( newRootShadowNode) , newRevisionNumber, telemetry};
398398
399399 currentRevision_ = newRevision;
400400 }
401401
402402 emitLayoutEvents (affectedLayoutableNodes);
403403
404404 if (commitMode == CommitMode::Normal) {
405- mount (newRevision, commitOptions.mountSynchronously );
405+ mount (std::move ( newRevision) , commitOptions.mountSynchronously );
406406 }
407407
408408 return CommitStatus::Succeeded;
@@ -413,10 +413,9 @@ ShadowTreeRevision ShadowTree::getCurrentRevision() const {
413413 return currentRevision_;
414414}
415415
416- void ShadowTree::mount (
417- ShadowTreeRevision const &revision,
418- bool mountSynchronously) const {
419- mountingCoordinator_->push (revision);
416+ void ShadowTree::mount (ShadowTreeRevision revision, bool mountSynchronously)
417+ const {
418+ mountingCoordinator_->push (std::move (revision));
420419 delegate_.shadowTreeDidFinishTransaction (
421420 mountingCoordinator_, mountSynchronously);
422421}
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ class ShadowTree final {
134134 private:
135135 constexpr static ShadowTreeRevision::Number INITIAL_REVISION{0 };
136136
137- void mount (ShadowTreeRevision const & revision, bool mountSynchronously) const ;
137+ void mount (ShadowTreeRevision revision, bool mountSynchronously) const ;
138138
139139 void emitLayoutEvents (
140140 std::vector<LayoutableShadowNode const *> &affectedLayoutableNodes) const ;
You can’t perform that action at this time.
0 commit comments