diff options
author | Sven Gothel <[email protected]> | 2022-08-05 09:34:13 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-08-05 09:34:13 +0200 |
commit | bf744eea7c0779548b38417c85c66dee4d3d4d93 (patch) | |
tree | 0a4df69b712386a68b966ddae76806cde03bc3d1 /java_jni/jni | |
parent | fbd142826ee3f8235c864e3ed09c8fc85dc470ed (diff) |
helper_jni.cxx: Simplify from_jboolean_to_bool() (unused so far)
Diffstat (limited to 'java_jni/jni')
-rw-r--r-- | java_jni/jni/helper_jni.cxx | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/java_jni/jni/helper_jni.cxx b/java_jni/jni/helper_jni.cxx index 24aea55..1b50df9 100644 --- a/java_jni/jni/helper_jni.cxx +++ b/java_jni/jni/helper_jni.cxx @@ -315,25 +315,13 @@ jfieldID jau::jni::search_field(JNIEnv *env, jclass clazz, const char *field_nam bool jau::jni::from_jboolean_to_bool(jboolean val) { - bool result; - - if (val == JNI_TRUE) - { - result = true; - } - else - { - if (val == JNI_FALSE) - { - result = false; - } - else - { - throw jau::InternalError("the jboolean value is not true/false", E_FILE_LINE); - } + if( JNI_TRUE == val ) { + return true; + } else if( JNI_FALSE == val ) { + return false; + } else { + throw jau::InternalError("the jboolean value is not true/false", E_FILE_LINE); } - - return result; } std::string jau::jni::from_jstring_to_string(JNIEnv *env, jstring str) { |