]> Kevux Git Server - fll/commitdiff
Cleanup: Improve if condition logic in Controller entry file.
authorKevin Day <Kevin@kevux.org>
Sat, 8 Jun 2024 04:21:11 +0000 (23:21 -0500)
committerKevin Day <Kevin@kevux.org>
Sat, 8 Jun 2024 04:21:11 +0000 (23:21 -0500)
The code has some unnecessary conditions.
Remove these.

Use greater than rather than multiple equals.

level_3/controller/c/entry/private-entry.c

index c1cf331ca01a4fdf208670d5d9e8605b90bd798a..6e9449426eb817ae93c483989d95ffb1554e629a 100644 (file)
@@ -1154,7 +1154,7 @@ extern "C" {
 
           f_thread_unlock(&global->thread->lock.rule);
 
-          if (global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e || global->main->error.verbosity == f_console_verbosity_verbose_e || global->main->error.verbosity == f_console_verbosity_debug_e || (entry->show == controller_entry_show_init_e && entry_action->type != controller_entry_action_type_consider_e)) {
+          if (global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e || global->main->error.verbosity > f_console_verbosity_normal_e || (entry->show == controller_entry_show_init_e && entry_action->type != controller_entry_action_type_consider_e)) {
             if (global->main->output.verbosity != f_console_verbosity_quiet_e && global->main->error.verbosity != f_console_verbosity_error_e) {
               controller_lock_print(global->main->output.to, global->thread);
 
@@ -1503,7 +1503,7 @@ extern "C" {
       }
     }
 
-    if ((global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e && global->main->error.verbosity != f_console_verbosity_quiet_e) && global->main->error.verbosity != f_console_verbosity_error_e || global->main->error.verbosity == f_console_verbosity_verbose_e) {
+    if ((global->main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e && global->main->error.verbosity > f_console_verbosity_error_e) || global->main->error.verbosity > f_console_verbosity_normal_e) {
       controller_lock_print(global->main->output.to, global->thread);
 
       fl_print_format("%rDone processing %r item '", global->main->output.to.stream, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);