Преглед на файлове

+ remove try ... finally statements if the finally block is empty

git-svn-id: trunk@48174 -
florian преди 4 години
родител
ревизия
16f201292c
променени са 1 файла, в които са добавени 7 реда и са изтрити 0 реда
  1. 7 0
      compiler/nflw.pas

+ 7 - 0
compiler/nflw.pas

@@ -2722,6 +2722,13 @@ implementation
            result:=right;
            result:=right;
            right:=nil;
            right:=nil;
          end;
          end;
+       { if the finally block contains no code, we can kill
+         it and just return the try part }
+       if has_no_code(right) and not(assigned(third)) and not(implicitframe) then
+         begin
+           result:=left;
+           left:=nil;
+         end;
      end;
      end;