Browse Source

* "checkcontinue" replaced with "has_child_of_type(..., [continuen])"

J. Gareth "Curious Kit" Moreton 1 year ago
parent
commit
205e4f3421
1 changed files with 1 additions and 10 deletions
  1. 1 10
      compiler/nflw.pas

+ 1 - 10
compiler/nflw.pas

@@ -1916,15 +1916,6 @@ implementation
       end;
       end;
 
 
 
 
-    function checkcontinue(var n:tnode; arg: pointer): foreachnoderesult;
-      begin
-        if n.nodetype=continuen then
-          result:=fen_norecurse_true
-        else
-          result:=fen_false;
-      end;
-
-
     function tfornode.makewhileloop : tnode;
     function tfornode.makewhileloop : tnode;
       var
       var
         ifblock,loopblock : tblocknode;
         ifblock,loopblock : tblocknode;
@@ -2007,7 +1998,7 @@ implementation
           not((lnf_backward in loopflags) and (get_ordinal_value(t1)=countermin)) and
           not((lnf_backward in loopflags) and (get_ordinal_value(t1)=countermin)) and
           { neither might the for loop contain a continue statement as continue in a while loop would skip the increment at the end
           { neither might the for loop contain a continue statement as continue in a while loop would skip the increment at the end
             of the loop, this could be overcome by replacing the continue statement with an pred/succ; continue sequence }
             of the loop, this could be overcome by replacing the continue statement with an pred/succ; continue sequence }
-          not(foreachnodestatic(t2,@checkcontinue,nil)) and
+          not(has_node_of_type(t2,[continuen])) and
           { if the loop is unrolled and there is a jump into the loop,
           { if the loop is unrolled and there is a jump into the loop,
             then we can't do the trick with incrementing the loop var only at the
             then we can't do the trick with incrementing the loop var only at the
             end
             end