LOOP: Correctly implement MXLOOPS and add a test.
[pspp-builds.git] / src / language / control / loop.c
index e91d9438f39c131836141ee2be53d47c970d2904..e4877b9e82cd126a90d9936953760df456d6f66d 100644 (file)
@@ -367,12 +367,8 @@ end_loop_trns_proc (void *loop_, struct ccase **c, casenumber case_num UNUSED)
     goto break_out;
 
   /* MXLOOPS limiter. */
-  if (loop->max_pass_count >= 0)
-    {
-      if (loop->pass >= loop->max_pass_count)
-        goto break_out;
-      loop->pass++;
-    }
+  if (loop->max_pass_count >= 0 && ++loop->pass >= loop->max_pass_count)
+    goto break_out;
 
   /* Indexing clause limiter: counting downward. */
   if (loop->index_var != NULL)