From 1148622da477b48b25805d7bf0a7a3f56739bbe4 Mon Sep 17 00:00:00 2001 From: Ilya Ryzhenkov Date: Sat, 12 Jul 2014 03:09:13 +0400 Subject: Simplify comment trimming. --- src/Analysis/CommentsAPI.kt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/Analysis/CommentsAPI.kt') diff --git a/src/Analysis/CommentsAPI.kt b/src/Analysis/CommentsAPI.kt index 03b1911c..6bdc3716 100644 --- a/src/Analysis/CommentsAPI.kt +++ b/src/Analysis/CommentsAPI.kt @@ -30,14 +30,10 @@ fun KDoc?.extractText(): String { return "" val lines = text.replace("\r", "").split("\n") return lines.map { - val comment = it.trim() - .dropWhile { it == '/' } - .dropWhile { it == '*' } - .dropWhile { it == '/' } - .trim() - if (comment.endsWith("*/")) - comment.substring(0, comment.length - 2).trim() + val comment = it.trim().dropWhile { it == '/' || it == '*'} + (if (comment.endsWith("*/")) + comment.substring(0, comment.length - 2) else - comment + comment).trim() }.filter { it.any() }.join("\n") } \ No newline at end of file -- cgit