1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/benchmark.rb (Benchmark#bmbm): use ensure clause instead of

Object#tap to restore STDOUT.sync.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2011-02-07 14:01:01 +00:00
parent afe7aac47b
commit b50d85ebc6
2 changed files with 7 additions and 2 deletions

View file

@ -266,9 +266,9 @@ module Benchmark
GC.start
print label.ljust(width)
Benchmark.measure(&item).tap { |res| print res.format }
}.tap {
STDOUT.sync = sync
}
ensure
STDOUT.sync = sync unless sync.nil?
end
#