summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-09 16:25:53 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-09 16:25:53 (GMT)
commita6b221f238f47687529751bcea93023548c6bdf8 (patch)
tree01b60965635115d6c1b9626f6a759c817c98557e /random.c
parentbc7a845a80f142810e70c27cbc7186a7973460e0 (diff)
random.c: compare by rb_equal
* random.c (random_equal): compare seeds by rb_equal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/random.c b/random.c
index a008064..6e6dae7 100644
--- a/random.c
+++ b/random.c
@@ -1346,11 +1346,10 @@ random_equal(VALUE self, VALUE other)
if (rb_obj_class(self) != rb_obj_class(other)) return Qfalse;
r1 = get_rnd(self);
r2 = get_rnd(other);
- if (!RTEST(rb_funcall2(r1->seed, rb_intern("=="), 1, &r2->seed))) return Qfalse;
if (memcmp(r1->mt.state, r2->mt.state, sizeof(r1->mt.state))) return Qfalse;
if ((r1->mt.next - r1->mt.state) != (r2->mt.next - r2->mt.state)) return Qfalse;
if (r1->mt.left != r2->mt.left) return Qfalse;
- return Qtrue;
+ return rb_equal(r1->seed, r2->seed);
}
/*