mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
numeric.c: limit return value
* numeric.c (num_equal): limit return value to true or false, instead of the result of the other as-is. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
97803e2250
commit
ffa371d9aa
1 changed files with 4 additions and 1 deletions
|
@ -1356,8 +1356,11 @@ num_cmp(VALUE x, VALUE y)
|
|||
static VALUE
|
||||
num_equal(VALUE x, VALUE y)
|
||||
{
|
||||
VALUE result;
|
||||
if (x == y) return Qtrue;
|
||||
return num_funcall1(y, id_eq, x);
|
||||
result = num_funcall1(y, id_eq, x);
|
||||
if (RTEST(result)) return Qtrue;
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue