1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-30 21:55:31 +02:00

Code streamlining.

This commit is contained in:
Sergey Prigogin 2011-01-31 18:12:38 +00:00
parent 270544ee2e
commit 253c5f1f03

View file

@ -3428,7 +3428,6 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
} catch (ASTProblemException e) { } catch (ASTProblemException e) {
skipToNode(statements.get(1)); skipToNode(statements.get(1));
} }
final boolean previousStatementIsNullStmt= previousStatement instanceof IASTNullStatement;
final int indentLevel= scribe.indentationLevel; final int indentLevel= scribe.indentationLevel;
for (int i = 1; i < statementsLength - 1; i++) { for (int i = 1; i < statementsLength - 1; i++) {
final IASTStatement statement= statements.get(i); final IASTStatement statement= statements.get(i);
@ -3436,8 +3435,7 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
continue; continue;
} }
final boolean statementIsNullStmt= statement instanceof IASTNullStatement; final boolean statementIsNullStmt= statement instanceof IASTNullStatement;
if ((previousStatementIsNullStmt && !statementIsNullStmt) if (!statementIsNullStmt) {
|| (!previousStatementIsNullStmt && !statementIsNullStmt)) {
scribe.startNewLine(); scribe.startNewLine();
} }
try { try {
@ -3459,8 +3457,7 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
} }
final IASTStatement statement= statements.get(statementsLength - 1); final IASTStatement statement= statements.get(statementsLength - 1);
final boolean statementIsNullStmt= statement instanceof IASTNullStatement; final boolean statementIsNullStmt= statement instanceof IASTNullStatement;
if ((previousStatementIsNullStmt && !statementIsNullStmt) if (!statementIsNullStmt) {
|| (!previousStatementIsNullStmt && !statementIsNullStmt)) {
scribe.startNewLine(); scribe.startNewLine();
} }
statement.accept(this); statement.accept(this);