mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
Refactoring:
- Merged declaration an initialization of result variable in initializerList, as conditional initialization is executed exactly once, unless a parse exception occurs. - Removed dead code: Conditional return. Change-Id: Ia8c2bcb5f76a56d6b71ad80095a546ebd4f9ac03
This commit is contained in:
parent
fae217d744
commit
db70bb0f29
1 changed files with 1 additions and 8 deletions
|
@ -3546,7 +3546,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
*/
|
||||
private List<IASTInitializerClause> initializerList(boolean allowSkipping) throws EndOfFileException,
|
||||
BacktrackException {
|
||||
List<IASTInitializerClause> result= null;
|
||||
List<IASTInitializerClause> result= new ArrayList<IASTInitializerClause>();
|
||||
// List of initializer clauses
|
||||
loop: while (true) {
|
||||
// Clause may be null, add to initializer anyways, such that the size can be computed.
|
||||
|
@ -3563,9 +3563,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
clause= setRange(packExpansion, clause, endOffset);
|
||||
}
|
||||
}
|
||||
if (result == null) {
|
||||
result= new ArrayList<IASTInitializerClause>();
|
||||
}
|
||||
result.add(clause);
|
||||
if (LT(1) != IToken.tCOMMA)
|
||||
break;
|
||||
|
@ -3577,10 +3574,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
}
|
||||
consume(IToken.tCOMMA);
|
||||
}
|
||||
|
||||
if (result == null)
|
||||
return Collections.emptyList();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue