Permalink
Browse files

Make chomp! specs actually do some work.

  • Loading branch information...
1 parent 18066d4 commit dbd17069195c7df2d7e07deab092a2f43566afdd @headius headius committed Mar 19, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 benchmark/core/string/bench_chomp.rb
@@ -38,35 +38,35 @@
i += 1
end
end
-
+
x.report "chomp!, std separator, multiple EOL" do |times|
i = 0
while i < times
- multiple_eol.chomp!
+ multiple_eol.dup.chomp!
i += 1
end
end
x.report "chomp!, std separator, no EOL" do |times|
i = 0
while i < times
- no_eol.chomp!
+ no_eol.dup.chomp!
i += 1
end
end
x.report "chomp!, std separator, multiple LF" do |times|
i = 0
while i < times
- multiple_lf.chomp!
+ multiple_lf.dup.chomp!
i += 1
end
end
x.report "chomp!, std separator, empty string" do |times|
i = 0
while i < times
- empty_string.chomp!
+ empty_string.dup.chomp!
i += 1
end
end

0 comments on commit dbd1706

Please sign in to comment.