From 16f201292c0690d29ee40a4b525a60c13d203c7c Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 18 Jan 2021 21:29:52 +0000 Subject: [PATCH] + remove try ... finally statements if the finally block is empty git-svn-id: trunk@48174 - --- compiler/nflw.pas | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/nflw.pas b/compiler/nflw.pas index 527484385a..81656029b7 100644 --- a/compiler/nflw.pas +++ b/compiler/nflw.pas @@ -2722,6 +2722,13 @@ implementation result:=right; right:=nil; 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;