timeout.rb: freeze a string message
* lib/timeout.rb (Timeout#timeout): freeze a string message to reduce string allocations. [Fix GH-996] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d22a09e189
commit
b0f2785d6c
@ -1,3 +1,8 @@
|
|||||||
|
Thu Aug 13 22:49:42 2015 Juanito Fatas <katehuang0320@gmail.com>
|
||||||
|
|
||||||
|
* lib/timeout.rb (Timeout#timeout): freeze a string message to
|
||||||
|
reduce string allocations. [Fix GH-996]
|
||||||
|
|
||||||
Thu Aug 13 17:42:34 2015 Koichi Sasada <ko1@atdot.net>
|
Thu Aug 13 17:42:34 2015 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* vm_core.h (rb_call_info_kw_arg_bytes): move the definition
|
* vm_core.h (rb_call_info_kw_arg_bytes): move the definition
|
||||||
|
@ -71,7 +71,7 @@ module Timeout
|
|||||||
# a module method, so you can call it directly as Timeout.timeout().
|
# a module method, so you can call it directly as Timeout.timeout().
|
||||||
def timeout(sec, klass = nil) #:yield: +sec+
|
def timeout(sec, klass = nil) #:yield: +sec+
|
||||||
return yield(sec) if sec == nil or sec.zero?
|
return yield(sec) if sec == nil or sec.zero?
|
||||||
message = "execution expired"
|
message = "execution expired".freeze
|
||||||
e = Error
|
e = Error
|
||||||
bl = proc do |exception|
|
bl = proc do |exception|
|
||||||
begin
|
begin
|
||||||
|
Loading…
x
Reference in New Issue
Block a user