Skip to content
Browse files
Make Lambda function called in NativeModule mutable to improve perfor…
…mance (#28297)

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
  • Loading branch information
maschad authored and facebook-github-bot committed Mar 16, 2020
1 parent bcf2a71 commit 5290047d09c0a41c85a1d47a638877c226d9c191
Showing 1 changed file with 1 addition and 1 deletion.
@@ -148,7 +148,7 @@ void CxxNativeModule::invoke(
// mhorowitz #7128529: convert C++ exceptions to Java

[method, params = std::move(params), first, second, callId]() {
[method, params = std::move(params), first, second, callId]() mutable {
if (callId != -1) {
fbsystrace_end_async_flow(TRACE_TAG_REACT_APPS, "native", callId);

0 comments on commit 5290047

Please sign in to comment.