Commits

Shlomi Fish  committed d47caeb

Refactoring: merge two ifs.

  • Participants
  • Parent commits fdcbaf3

Comments (0)

Files changed (1)

File fc-solve/source/lib.c

                user, \
                &(instance_item->flares[idx]) \
            ))
-            if (instance_item->minimal_solution_flare_idx < 0)
-            {
-                instance_item->minimal_solution_flare_idx = flare_idx;
-            }
-            else if (
-                FLARE_MOVE_COUNT(instance_item->minimal_solution_flare_idx)
-                 >
-                FLARE_MOVE_COUNT(flare_idx)
+            if (
+                (instance_item->minimal_solution_flare_idx < 0)
+                 ||
+                (
+                    FLARE_MOVE_COUNT(instance_item->minimal_solution_flare_idx)
+                    >
+                    FLARE_MOVE_COUNT(flare_idx)
+                )
             )
             {
                 instance_item->minimal_solution_flare_idx = flare_idx;
             }
+#undef FLARE_MOVE_COUNT
             ret = user->ret_code = FCS_STATE_IS_NOT_SOLVEABLE;
         }
         else if (user->ret_code == FCS_STATE_SUSPEND_PROCESS)