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

ruby-changes:24825

From: knu <ko1@a...>
Date: Sat, 1 Sep 2012 18:52:00 +0900 (JST)
Subject: [ruby-changes:24825] knu:r36876 (trunk): * lib/set.rb (#initialize_copy, #eql): Use instance_variable_get

knu	2012-09-01 18:51:48 +0900 (Sat, 01 Sep 2012)

  New Revision: 36876

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

  Log:
    * lib/set.rb (#initialize_copy, #eql): Use instance_variable_get
      instead of instance_eval.

  Modified files:
    trunk/ChangeLog
    trunk/lib/set.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 36875)
+++ ChangeLog	(revision 36876)
@@ -1,3 +1,8 @@
+Sat Sep  1 18:50:50 2012  Akinori MUSHA  <knu@i...>
+
+	* lib/set.rb (#initialize_copy, #eql): Use instance_variable_get
+	  instead of instance_eval.
+
 Fri Aug 31 21:47:56 2012  Kouhei Sutou  <kou@c...>
 
 	* lib/test/unit/test-unit.gemspec: Make test/unit default gem.
Index: lib/set.rb
===================================================================
--- lib/set.rb	(revision 36875)
+++ lib/set.rb	(revision 36876)
@@ -96,7 +96,7 @@
 
   # Copy internal hash.
   def initialize_copy(orig)
-    @hash = orig.instance_eval{@hash}.dup
+    @hash = orig.instance_variable_get(:@hash).dup
   end
 
   def freeze    # :nodoc:
@@ -384,7 +384,7 @@
 
   def eql?(o)   # :nodoc:
     return false unless o.is_a?(Set)
-    @hash.eql?(o.instance_eval{@hash})
+    @hash.eql?(o.instance_variable_get(:@hash))
   end
 
   # Classifies the set by the return value of the given block and

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

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