From afc69e275d9141f2c889aa17998393e631f645ab Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Thu, 4 Apr 2019 10:12:34 +0200 Subject: [PATCH] early return --- src/u_main.pas | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/u_main.pas b/src/u_main.pas index d178078b..8630c749 100644 --- a/src/u_main.pas +++ b/src/u_main.pas @@ -3714,13 +3714,12 @@ end; function TMainForm.checkProjectLock(message: boolean = true): boolean; begin result := false; - if fProjActionsLock then - begin - result := true; - if message then - dlgOkInfo('This action is disabled while a project compiles', - 'Project lock warning'); - end + if not fProjActionsLock then + exit; + result := true; + if message then + dlgOkInfo('This action is disabled while a project compiles', + 'Project lock warning'); end; procedure TMainForm.showProjTitle;