From 49ed2a756bb41e4e3d3b520d0f84a60851504fe2 Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 28 Nov 2012 08:00:53 +0000 Subject: [PATCH] * proc.c: remove Proc#== and Proc#eql?. Proc objects compared with thier object ids. * test/ruby/test_proc.rb: remove related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ proc.c | 33 --------------------------------- test/ruby/test_proc.rb | 6 ------ 3 files changed, 7 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6cddaf0208..be1a665e89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Nov 28 16:59:12 2012 Koichi Sasada + + * proc.c: remove Proc#== and Proc#eql?. + Proc objects compared with thier object ids. + + * test/ruby/test_proc.rb: remove related test. + Wed Nov 28 16:41:04 2012 Eric Hodel * lib/rdoc/servlet.rb: Add support for serving documentation from a diff --git a/proc.c b/proc.c index b387eb0ba7..c15be180ab 100644 --- a/proc.c +++ b/proc.c @@ -774,37 +774,6 @@ rb_proc_parameters(VALUE self) return rb_iseq_parameters(iseq, is_proc); } -/* - * call-seq: - * prc == other_proc -> true or false - * - * Returns true if prc is the same object as - * other_proc, or if they are both procs with the same body. - */ - -static VALUE -proc_eq(VALUE self, VALUE other) -{ - if (self == other) { - return Qtrue; - } - else { - if (rb_obj_is_proc(other)) { - rb_proc_t *p1, *p2; - GetProcPtr(self, p1); - GetProcPtr(other, p2); - if (p1->envval == p2->envval && - p1->block.iseq->iseq_size == p2->block.iseq->iseq_size && - p1->block.iseq->local_size == p2->block.iseq->local_size && - MEMCMP(p1->block.iseq->iseq, p2->block.iseq->iseq, VALUE, - p1->block.iseq->iseq_size) == 0) { - return Qtrue; - } - } - } - return Qfalse; -} - st_index_t rb_hash_proc(st_index_t hash, VALUE prc) { @@ -2241,8 +2210,6 @@ Init_Proc(void) rb_define_method(rb_cProc, "arity", proc_arity, 0); rb_define_method(rb_cProc, "clone", proc_clone, 0); rb_define_method(rb_cProc, "dup", proc_dup, 0); - rb_define_method(rb_cProc, "==", proc_eq, 1); - rb_define_method(rb_cProc, "eql?", proc_eq, 1); rb_define_method(rb_cProc, "hash", proc_hash, 0); rb_define_method(rb_cProc, "to_s", proc_to_s, 0); rb_define_alias(rb_cProc, "inspect", "to_s"); diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb index b2ce8bcf62..0fed9224ec 100644 --- a/test/ruby/test_proc.rb +++ b/test/ruby/test_proc.rb @@ -339,12 +339,6 @@ class TestProc < Test::Unit::TestCase t.kill end - def test_eq2 - b1 = proc { } - b2 = b1.dup - assert(b1 == b2) - end - def test_to_proc b = proc { :foo } assert_equal(:foo, b.to_proc.call)