From 00266693b38aa4b055dc6f0fdba7d12a08e23d7e Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 31 Oct 2019 17:19:00 -0700 Subject: [PATCH] Avoid copying vector in mounting layer of Fabric Summary: easy diff to avoid the constant copy of a vector when calling the method Binding.createRemoveAndDeleteMultiMountItem. Since we are not modifing the vector inside the method createRemoveAndDeleteMultiMountItem it's not necessary to copy it. Changelog: Improve performance in mounting of Fabric views Reviewed By: JoshuaGross Differential Revision: D18250376 fbshipit-source-id: c984214a8148bab521cec51d42ba54a4b73e3e67 --- .../src/main/java/com/facebook/react/fabric/jni/Binding.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp index e1f5b6af696..ccd9838299a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp @@ -475,7 +475,7 @@ local_ref createDeleteMountItem( local_ref createRemoveAndDeleteMultiMountItem( const jni::global_ref &javaUIManager, - std::vector metadata) { + const std::vector &metadata) { auto env = Environment::current(); auto removeAndDeleteArray = env->NewIntArray(metadata.size()*4);