Skip to content

Commit

Permalink
try again
Browse files Browse the repository at this point in the history
  • Loading branch information
li-feng-sc committed Jul 26, 2024
1 parent 0c74a2a commit c0b131e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions support-lib/jni/Marshal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,21 +311,19 @@ namespace djinni

using Boxed = Optional;

static CppType toCpp(JNIEnv* jniEnv, JniType j)
{
static CppType toCpp(JNIEnv* jniEnv, JniType j) {
if (j) {
return T::Boxed::toCpp(jniEnv, j);
} else {
return CppType();
}
}

static LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const OptionalType<typename T::CppType> &c)
{
static LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const OptionalType<typename T::CppType> &c) {
return c ? T::Boxed::fromCpp(jniEnv, *c) : LocalRef<JniType>{ };
}
static LocalRef<JniType> fromCpp(JNIEnv* jniEnv, OptionalType<typename T::CppType>&& c)
{

static LocalRef<JniType> fromCpp(JNIEnv* jniEnv, OptionalType<typename T::CppType>&& c) {
return c ? T::Boxed::fromCpp(jniEnv, std::move(*c)) : LocalRef<JniType>{ };
}

Expand Down

0 comments on commit c0b131e

Please sign in to comment.