hash.c: fix return value
* hash.c (hash_equal): prefer true than the result of implicit conversion from int returned by rb_eql() to VALUE. [Fix GH-789] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7ce07a85fe
commit
62d43632ba
@ -1,3 +1,8 @@
|
|||||||
|
Fri Dec 19 15:36:02 2014 Simon Genier <simon.genier@shopify.com>
|
||||||
|
|
||||||
|
* hash.c (hash_equal): prefer true than the result of implicit
|
||||||
|
conversion from int returned by rb_eql() to VALUE. [Fix GH-789]
|
||||||
|
|
||||||
Thu Dec 18 17:45:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Dec 18 17:45:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* configure.in (rb_cv_binary_elf): get rid of -e option of cat
|
* configure.in (rb_cv_binary_elf): get rid of -e option of cat
|
||||||
|
13
hash.c
13
hash.c
@ -1944,10 +1944,17 @@ hash_equal(VALUE hash1, VALUE hash2, int eql)
|
|||||||
if (!rb_respond_to(hash2, idTo_hash)) {
|
if (!rb_respond_to(hash2, idTo_hash)) {
|
||||||
return Qfalse;
|
return Qfalse;
|
||||||
}
|
}
|
||||||
if (eql)
|
if (eql) {
|
||||||
return rb_eql(hash2, hash1);
|
if (rb_eql(hash2, hash1)) {
|
||||||
else
|
return Qtrue;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return Qfalse;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
return rb_equal(hash2, hash1);
|
return rb_equal(hash2, hash1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (RHASH_SIZE(hash1) != RHASH_SIZE(hash2))
|
if (RHASH_SIZE(hash1) != RHASH_SIZE(hash2))
|
||||||
return Qfalse;
|
return Qfalse;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user