Browse Source

fcl-passrc: paswrite: omit useless calling DecIdent and IncIdent in WriteImplElement method

git-svn-id: trunk@36623 -
maciej-izak 8 years ago
parent
commit
c5941e109f
1 changed files with 16 additions and 8 deletions
  1. 16 8
      packages/fcl-passrc/src/paswrite.pp

+ 16 - 8
packages/fcl-passrc/src/paswrite.pp

@@ -475,26 +475,34 @@ begin
     WriteImplCommand(TPasImplCommand(AElement))
   else if AElement.ClassType = TPasImplCommands then
   begin
-    DecIndent;
     if AAutoInsertBeginEnd then
+    begin
+      DecIndent;
       wrtln('begin');
-    IncIndent;
+      IncIndent;
+    end;
     WriteImplCommands(TPasImplCommands(AElement));
-    DecIndent;
     if AAutoInsertBeginEnd then
+    begin
+      DecIndent;
       wrtln('end;');
-    IncIndent;
+      IncIndent;
+    end;
   end else if AElement.ClassType = TPasImplBlock then
   begin
-    DecIndent;
     if AAutoInsertBeginEnd then
+    begin
+      DecIndent;
       wrtln('begin');
-    IncIndent;
+      IncIndent;
+    end;
     WriteImplBlock(TPasImplBlock(AElement));
-    DecIndent;
     if AAutoInsertBeginEnd then
+    begin
+      DecIndent;
       wrtln('end;');
-    IncIndent;
+      IncIndent;
+    end;
   end else if AElement.ClassType = TPasImplIfElse then
     WriteImplIfElse(TPasImplIfElse(AElement))
   else if AElement.ClassType = TPasImplForLoop then