changeset 244:a560b92bfd72

add comment
author sugi
date Wed, 08 May 2013 18:31:55 +0900
parents c70cd1b2caca
children e5d0bd8200c6
files src/alice/test/codesegment/local/wordcount/CorrectResult.java src/alice/test/codesegment/local/wordcount/WordCount.java
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/alice/test/codesegment/local/wordcount/CorrectResult.java	Wed May 08 15:43:49 2013 +0900
+++ b/src/alice/test/codesegment/local/wordcount/CorrectResult.java	Wed May 08 18:31:55 2013 +0900
@@ -27,8 +27,7 @@
 			line_num +=result.line_num;
 			word_num +=result.word_num;
 		}
-		long t = System.currentTimeMillis();
-		System.out.println(t - StartWordCount.t);
+		System.out.println(System.currentTimeMillis() - StartWordCount.t);
 		System.out.println(line_num+" "+word_num);
 		System.exit(0);
 		
--- a/src/alice/test/codesegment/local/wordcount/WordCount.java	Wed May 08 15:43:49 2013 +0900
+++ b/src/alice/test/codesegment/local/wordcount/WordCount.java	Wed May 08 18:31:55 2013 +0900
@@ -37,6 +37,8 @@
 		}
 		word_num += word_flag;
 		if (!r.flag){
+			// buf.get(r.end) is next block's char.
+			// buf.get(r.end-1) is this block's last char
 			if (((char)buf.get(r.end-1) == 0x0A||(char)buf.get(r.end-1) == 0x20) &&
 					((char)buf.get(r.end) == 0x0A||(char)buf.get(r.end) == 0x20)){
 				word_num--;