Revert D48712710: C++ Cleanup 3/N: Reorganize YGNode

Differential Revision:
D48712710

Original commit changeset: d28eae38469a

Original Phabricator Diff: D48712710

fbshipit-source-id: 7a10b071edcf045ce98bbf8f9deca0d0e2e80a14
This commit is contained in:
Zhiyao Zhou
2023-08-29 23:27:25 -07:00
committed by Facebook GitHub Bot
parent 6ca56e87ce
commit ea7f61a3db
31 changed files with 578 additions and 625 deletions

View File

@@ -14,12 +14,11 @@
#include "jni.h"
class PtrJNodeMapVanilla {
std::map<YGNodeConstRef, size_t> ptrsToIdxs_{};
jobjectArray javaNodes_{};
std::map<YGNodeRef, size_t> ptrsToIdxs_;
jobjectArray javaNodes_;
public:
PtrJNodeMapVanilla() = default;
PtrJNodeMapVanilla() : ptrsToIdxs_{}, javaNodes_{} {}
PtrJNodeMapVanilla(jlongArray javaNativePointers, jobjectArray javaNodes)
: javaNodes_{javaNodes} {
using namespace facebook::yoga::vanillajni;
@@ -31,11 +30,11 @@ public:
javaNativePointers, 0, nativePointersSize, nativePointers.data());
for (size_t i = 0; i < nativePointersSize; ++i) {
ptrsToIdxs_[(YGNodeConstRef) nativePointers[i]] = i;
ptrsToIdxs_[(YGNodeRef) nativePointers[i]] = i;
}
}
facebook::yoga::vanillajni::ScopedLocalRef<jobject> ref(YGNodeConstRef node) {
facebook::yoga::vanillajni::ScopedLocalRef<jobject> ref(YGNodeRef node) {
using namespace facebook::yoga::vanillajni;
JNIEnv* env = getCurrentEnv();