Skip to content

Commit 5290047

Browse files
maschadfacebook-github-bot
authored andcommitted
Make Lambda function called in NativeModule mutable to improve performance (#28297)
Summary: Fixes #28271 As explained by mmallet-youilabs , if the parameters passed to the `move` function are too expensive, this can have an impact on performance. Thus making these parameters captured by value mutable, the parameters are not movable. ## Changelog [iOS] [Fixed] - Message Pull Request resolved: #28297 Test Plan: Steps to reproduce (and expected results) are not applicable (unless running with a profiler). Differential Revision: D20464278 Pulled By: shergin fbshipit-source-id: 846a8bc6c61cb4aa21fbd96b419c3775190a2c84
1 parent bcf2a71 commit 5290047

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ReactCommon/cxxreact/CxxNativeModule.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void CxxNativeModule::invoke(
148148
// mhorowitz #7128529: convert C++ exceptions to Java
149149

150150
messageQueueThread_->runOnQueue(
151-
[method, params = std::move(params), first, second, callId]() {
151+
[method, params = std::move(params), first, second, callId]() mutable {
152152
#ifdef WITH_FBSYSTRACE
153153
if (callId != -1) {
154154
fbsystrace_end_async_flow(TRACE_TAG_REACT_APPS, "native", callId);

0 commit comments

Comments
 (0)