Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSergey Prigogin2013-05-13 21:01:29 -0400
committerSergey Prigogin2013-05-13 21:01:29 -0400
commit12d8ae41e2ea4631e8ab6d5467019536d0a35db8 (patch)
treee8b3cda2318aa617d5066da2d4e07898b4777daa /core
parente543e223a408a13b384ebfa803971c41b36fdcab (diff)
downloadorg.eclipse.cdt-12d8ae41e2ea4631e8ab6d5467019536d0a35db8.tar.gz
org.eclipse.cdt-12d8ae41e2ea4631e8ab6d5467019536d0a35db8.tar.xz
org.eclipse.cdt-12d8ae41e2ea4631e8ab6d5467019536d0a35db8.zip
Code streamlining.
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/ASTCommenter.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/ASTCommenter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/ASTCommenter.java
index b891e54482..6713964575 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/ASTCommenter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/ASTCommenter.java
@@ -83,12 +83,9 @@ public class ASTCommenter {
}
private boolean isCommentOnSameLine(IASTNode node) {
- if (node.getFileLocation() == null) {
- return false;
- } else {
- return commentNodeLocation.getStartingLineNumber() == node.getFileLocation()
- .getEndingLineNumber();
- }
+ IASTFileLocation fileLocation = node.getFileLocation();
+ return fileLocation != null &&
+ commentNodeLocation.getStartingLineNumber() == fileLocation.getEndingLineNumber();
}
@Override

Back to the top