no need to pass env to ref method , we can directly use getCurrentEnv()
Summary: We can use getCurrentEnv() instead of passing environment variable around Reviewed By: amir-shalem Differential Revision: D17842042 fbshipit-source-id: 185b174ae7c08e746bc76c0600c2e326b15c4993
This commit is contained in:
committed by
Facebook Github Bot
parent
050893f15a
commit
869a33eb13
@@ -21,8 +21,7 @@ using facebook::yoga::detail::Log;
|
|||||||
static inline ScopedLocalRef<jobject> YGNodeJobject(
|
static inline ScopedLocalRef<jobject> YGNodeJobject(
|
||||||
YGNodeRef node,
|
YGNodeRef node,
|
||||||
void* layoutContext) {
|
void* layoutContext) {
|
||||||
return reinterpret_cast<PtrJNodeMapVanilla*>(layoutContext)
|
return reinterpret_cast<PtrJNodeMapVanilla*>(layoutContext)->ref(node);
|
||||||
->ref(getCurrentEnv(), node);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline YGNodeRef _jlong2YGNodeRef(jlong addr) {
|
static inline YGNodeRef _jlong2YGNodeRef(jlong addr) {
|
||||||
|
@@ -29,7 +29,8 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ScopedLocalRef<jobject> ref(JNIEnv* env, YGNodeRef node) {
|
ScopedLocalRef<jobject> ref(YGNodeRef node) {
|
||||||
|
JNIEnv* env = getCurrentEnv();
|
||||||
auto idx = ptrsToIdxs_.find(node);
|
auto idx = ptrsToIdxs_.find(node);
|
||||||
if (idx == ptrsToIdxs_.end()) {
|
if (idx == ptrsToIdxs_.end()) {
|
||||||
return ScopedLocalRef<jobject>(env);
|
return ScopedLocalRef<jobject>(env);
|
||||||
|
Reference in New Issue
Block a user