ruby-changes:61015
From: Benoit <ko1@a...>
Date: Wed, 6 May 2020 07:22:28 +0900 (JST)
Subject: [ruby-changes:61015] 00a9d697a8 (master): Remove redundant check in rb_obj_cmp()
https://git.ruby-lang.org/ruby.git/commit/?id=00a9d697a8 From 00a9d697a86325cbc97cc9adc41b0829d21c3ea1 Mon Sep 17 00:00:00 2001 From: Benoit Daloze <eregontp@g...> Date: Wed, 6 May 2020 00:09:56 +0200 Subject: Remove redundant check in rb_obj_cmp() * rb_equal() already checks using `obj1 == obj2`. diff --git a/object.c b/object.c index 61a9d62..fead841 100644 --- a/object.c +++ b/object.c @@ -1726,7 +1726,7 @@ rb_obj_not_match(VALUE obj1, VALUE obj2) https://github.com/ruby/ruby/blob/trunk/object.c#L1726 static VALUE rb_obj_cmp(VALUE obj1, VALUE obj2) { - if (obj1 == obj2 || rb_equal(obj1, obj2)) + if (rb_equal(obj1, obj2)) return INT2FIX(0); return Qnil; } -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/