1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Code streamlining.

This commit is contained in:
Sergey Prigogin 2012-11-27 19:04:17 -08:00
parent 67a81b6a4b
commit fdeda95079
2 changed files with 7 additions and 14 deletions

View file

@ -72,12 +72,8 @@ public class CPPASTAliasDeclaration extends ASTNode implements ICPPASTAliasDecla
public ICPPASTAliasDeclaration copy(CopyStyle style) { public ICPPASTAliasDeclaration copy(CopyStyle style) {
CPPASTAliasDeclaration copy = new CPPASTAliasDeclaration( CPPASTAliasDeclaration copy = new CPPASTAliasDeclaration(
aliasName == null ? null : aliasName.copy(style), aliasName == null ? null : aliasName.copy(style),
mappingTypeId == null ? null : mappingTypeId.copy(style)); mappingTypeId == null ? null : mappingTypeId.copy(style));
copy.setOffsetAndLength(this); return copy(copy, style);
if (style == CopyStyle.withLocations) {
copy.setCopyLocation(this);
}
return copy;
} }
@Override @Override

View file

@ -27,8 +27,8 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTQueries;
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent; import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
/** /**
* Models a function definition without a try-block. If used for a constructor definition it may contain * Models a function definition without a try-block. If used for a constructor definition
* member initializers. * it may contain member initializers.
*/ */
public class CPPASTFunctionDefinition extends ASTNode public class CPPASTFunctionDefinition extends ASTNode
implements ICPPASTFunctionDefinition, IASTAmbiguityParent { implements ICPPASTFunctionDefinition, IASTAmbiguityParent {
@ -68,16 +68,13 @@ public class CPPASTFunctionDefinition extends ASTNode
copy.setBody(bodyStatement == null ? null : bodyStatement.copy(style)); copy.setBody(bodyStatement == null ? null : bodyStatement.copy(style));
for (ICPPASTConstructorChainInitializer initializer : getMemberInitializers()) for (ICPPASTConstructorChainInitializer initializer : getMemberInitializers()) {
copy.addMemberInitializer(initializer == null ? null : initializer.copy(style)); copy.addMemberInitializer(initializer == null ? null : initializer.copy(style));
}
copy.fDefaulted = fDefaulted; copy.fDefaulted = fDefaulted;
copy.fDeleted = fDeleted; copy.fDeleted = fDeleted;
copy.setOffsetAndLength(this); return copy(copy, style);
if (style == CopyStyle.withLocations) {
copy.setCopyLocation(this);
}
return copy;
} }
@Override @Override