diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | hash.c | 13 |
2 files changed, 15 insertions, 3 deletions
@@ -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> * configure.in (rb_cv_binary_elf): get rid of -e option of cat @@ -1944,10 +1944,17 @@ hash_equal(VALUE hash1, VALUE hash2, int eql) if (!rb_respond_to(hash2, idTo_hash)) { return Qfalse; } - if (eql) - return rb_eql(hash2, hash1); - else + if (eql) { + if (rb_eql(hash2, hash1)) { + return Qtrue; + } + else { + return Qfalse; + } + } + else { return rb_equal(hash2, hash1); + } } if (RHASH_SIZE(hash1) != RHASH_SIZE(hash2)) return Qfalse; |