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:
parent
afe7aac47b
commit
b50d85ebc6
2 changed files with 7 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue