diff --git a/ChangeLog b/ChangeLog index 6b491d7290..1ea01e3e08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Feb 7 22:56:16 2011 CHIKANAGA Tomoyuki + + * lib/benchmark.rb (Benchmark#bmbm): use ensure clause instead of + Object#tap to restore STDOUT.sync. + Mon Feb 7 22:34:20 2011 Tanaka Akira * lib/net/http.rb (Net::HTTP#connect): support SNI (Server Name diff --git a/lib/benchmark.rb b/lib/benchmark.rb index 052b9add3b..ac17ba436d 100644 --- a/lib/benchmark.rb +++ b/lib/benchmark.rb @@ -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 #