Loop invariant optimization

This commit is contained in:
Roman Shevchenko
2010-08-01 22:04:44 +04:00
parent 9d5f3cb532
commit 8172377283
@@ -905,13 +905,14 @@ public class DeclarationParsing extends Parsing {
if (tokenType != JavaTokenType.SEMICOLON && tokenType != JavaTokenType.LBRACE){
CompositeElement invalidElementsGroup = Factory.createErrorElement(JavaErrorMessages.message("expected.lbrace.or.semicolon"));
method.rawAddChildren(invalidElementsGroup);
final CharSequence buf = lexer.getBufferSequence();
Loop:
while(true){
tokenType = lexer.getTokenType();
// Heuristic. Going to next line obviously means method signature is over, starting new method.
// Necessary for correct CompleteStatementTest operation.
final CharSequence buf = lexer.getBufferSequence();
int start = lexer.getTokenStart();
for (int i = start - 1; i >= 0; i--) {
if (buf.charAt(i) == '\n') break Loop;