mirror of
https://github.com/status-im/react-native.git
synced 2025-02-27 16:40:38 +00:00
Use findClassStatic instead of findClassLocal
Reviewed By: mhorowitz Differential Revision: D4420352 fbshipit-source-id: 8c66c1b2213fe295334a9bdc4e1dd7e1a4285aae
This commit is contained in:
parent
7cb5b6e523
commit
f249a78df6
@ -75,7 +75,8 @@ static void YGPrint(YGNodeRef node) {
|
||||
|
||||
static float YGJNIBaselineFunc(YGNodeRef node, float width, float height) {
|
||||
if (auto obj = YGNodeJobject(node)->lockLocal()) {
|
||||
return findClassLocal("com/facebook/yoga/YogaNode")->getMethod<jfloat(jfloat, jfloat)>("baseline")(obj, width, height);
|
||||
static auto baselineFunc = findClassStatic("com/facebook/yoga/YogaNode")->getMethod<jfloat(jfloat, jfloat)>("baseline");
|
||||
return baselineFunc(obj, width, height);
|
||||
} else {
|
||||
return height;
|
||||
}
|
||||
@ -87,7 +88,7 @@ static YGSize YGJNIMeasureFunc(YGNodeRef node,
|
||||
float height,
|
||||
YGMeasureMode heightMode) {
|
||||
if (auto obj = YGNodeJobject(node)->lockLocal()) {
|
||||
static auto measureFunc = findClassLocal("com/facebook/yoga/YogaNode")
|
||||
static auto measureFunc = findClassStatic("com/facebook/yoga/YogaNode")
|
||||
->getMethod<jlong(jfloat, jint, jfloat, jint)>("measure");
|
||||
|
||||
YGTransferLayoutDirection(node, obj);
|
||||
@ -121,7 +122,7 @@ static int YGLog(YGLogLevel level, const char *format, va_list args) {
|
||||
char buffer[256];
|
||||
int result = vsnprintf(buffer, sizeof(buffer), format, args);
|
||||
|
||||
static auto logFunc = findClassLocal("com/facebook/yoga/YogaLogger")
|
||||
static auto logFunc = findClassStatic("com/facebook/yoga/YogaLogger")
|
||||
->getMethod<void(local_ref<JYogaLogLevel>, jstring)>("log");
|
||||
|
||||
static auto logLevelFromInt =
|
||||
|
Loading…
x
Reference in New Issue
Block a user