[前][次][番号順一覧][スレッド一覧]

ruby-changes:39485

From: nobu <ko1@a...>
Date: Thu, 13 Aug 2015 22:50:04 +0900 (JST)
Subject: [ruby-changes:39485] nobu:r51566 (trunk): timeout.rb: freeze a string message

nobu	2015-08-13 22:49:44 +0900 (Thu, 13 Aug 2015)

  New Revision: 51566

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51566

  Log:
    timeout.rb: freeze a string message
    
    * lib/timeout.rb (Timeout#timeout): freeze a string message to
      reduce string allocations.  [Fix GH-996]

  Modified files:
    trunk/ChangeLog
    trunk/lib/timeout.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51565)
+++ ChangeLog	(revision 51566)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Aug 13 22:49:42 2015  Juanito Fatas  <katehuang0320@g...>
+
+	* 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@a...>
 
 	* vm_core.h (rb_call_info_kw_arg_bytes): move the definition
Index: lib/timeout.rb
===================================================================
--- lib/timeout.rb	(revision 51565)
+++ lib/timeout.rb	(revision 51566)
@@ -71,7 +71,7 @@ module Timeout https://github.com/ruby/ruby/blob/trunk/lib/timeout.rb#L71
   # a module method, so you can call it directly as Timeout.timeout().
   def timeout(sec, klass = nil)   #:yield: +sec+
     return yield(sec) if sec == nil or sec.zero?
-    message = "execution expired"
+    message = "execution expired".freeze
     e = Error
     bl = proc do |exception|
       begin

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]