aboutsummaryrefslogtreecommitdiffstats
path: root/benchmark/bm_so_count_words.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-27 06:46:31 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-27 06:46:31 +0000
commit87375866a629e64a646c1b32d0e50926a729ca11 (patch)
tree8db2b577f86f2c6957029bf1802aa341452f1a50 /benchmark/bm_so_count_words.rb
parent29538dbb0ed5dda03ecd6348b33ab29d174fcb58 (diff)
downloadruby-87375866a629e64a646c1b32d0e50926a729ca11.tar.gz
* benchmark/driver.rb: added.
* common.mk: fix to use above driver. * benchmark/prepare_so_count_words.rb: added. * benchmark/bm_so_count_words.rb: fix benchmark process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'benchmark/bm_so_count_words.rb')
-rw-r--r--benchmark/bm_so_count_words.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/benchmark/bm_so_count_words.rb b/benchmark/bm_so_count_words.rb
index a208004a9a..65f6337a4a 100644
--- a/benchmark/bm_so_count_words.rb
+++ b/benchmark/bm_so_count_words.rb
@@ -8,11 +8,12 @@ input = open(File.join(File.dirname($0), 'wc.input'), 'rb')
nl = nw = nc = 0
while true
- data = (input.read(4096) or break) << (input.gets || "")
+ tmp = input.read(4096) or break
+ data = tmp << (input.gets || "")
nc += data.length
nl += data.count("\n")
((data.strip! || data).tr!("\n", " ") || data).squeeze!
- #nw += data.count(" ") + 1
+ nw += data.count(" ") + 1
end
# STDERR.puts "#{nl} #{nw} #{nc}"