Skip to content

Commit

Permalink
Move variable declaration into if
Browse files Browse the repository at this point in the history
  • Loading branch information
chippmann committed May 20, 2024
1 parent 7626539 commit 2f61f59
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/jni/env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ namespace jni {

String Env::exception_describe() {
#ifdef DEBUG_ENABLED
jthrowable e = env->ExceptionOccurred();

if (e != nullptr) {
if (jthrowable e = env->ExceptionOccurred()) {
jclass string_writer_class {env->FindClass("java/io/StringWriter")};
jmethodID string_writer_constructor {env->GetMethodID(string_writer_class, "<init>", "()V")};
jobject string_writer {env->NewObject(string_writer_class, string_writer_constructor)};
Expand Down

0 comments on commit 2f61f59

Please sign in to comment.