From 8aa67abdb20788c09f0727fcbf61c7dabab210aa Mon Sep 17 00:00:00 2001 From: Sidharth Guglani Date: Thu, 10 Oct 2019 05:31:30 -0700 Subject: [PATCH] Fix YGNodeJobject method Summary: We can use getCurrentEnv() , no need to pass env around methods Reviewed By: amir-shalem Differential Revision: D17841281 fbshipit-source-id: a4a58292e70ac05b0f0b9eb962a82a8501ad0226 --- java/jni/YGJNIVanilla.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/java/jni/YGJNIVanilla.cpp b/java/jni/YGJNIVanilla.cpp index 4920ecab..3fb03ece 100644 --- a/java/jni/YGJNIVanilla.cpp +++ b/java/jni/YGJNIVanilla.cpp @@ -25,13 +25,6 @@ static inline ScopedLocalRef YGNodeJobject( ->ref(getCurrentEnv(), node); } -static inline ScopedLocalRef YGNodeJobject( - JNIEnv* env, - YGNodeRef node, - void* layoutContext) { - return reinterpret_cast(layoutContext)->ref(env, node); -} - static inline YGNodeRef _jlong2YGNodeRef(jlong addr) { return reinterpret_cast(static_cast(addr)); } @@ -272,7 +265,7 @@ static void YGTransferLayoutOutputsRecursive( if (!root->getHasNewLayout()) { return; } - auto obj = YGNodeJobject(env, root, layoutContext); + auto obj = YGNodeJobject(root, layoutContext); if (!obj) { Log::log( root,