diff options
author | 卜部昌平 <[email protected]> | 2021-05-10 09:59:10 +0900 |
---|---|---|
committer | 卜部昌平 <[email protected]> | 2021-05-12 10:30:46 +0900 |
commit | 0ab0b86c8491d639b9ff1335ddf35e341ecd867e (patch) | |
tree | 9babb5e225414ff3a708e8df3207b749dcc36d2a /compile.c | |
parent | e1eff837cf12a8e813de9d4ff2db50c9b68b86b5 (diff) |
cdhash_cmp: should use ||
cf: https://github.com/ruby/ruby/pull/4469#discussion_r628386707
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2008,12 +2008,12 @@ cdhash_cmp(VALUE val, VALUE lit) else if (tlit == T_RATIONAL) { const struct RRational *rat1 = RRATIONAL(val); const struct RRational *rat2 = RRATIONAL(lit); - return cdhash_cmp(rat1->num, rat2->num) && cdhash_cmp(rat1->den, rat2->den); + return cdhash_cmp(rat1->num, rat2->num) || cdhash_cmp(rat1->den, rat2->den); } else if (tlit == T_COMPLEX) { const struct RComplex *comp1 = RCOMPLEX(val); const struct RComplex *comp2 = RCOMPLEX(lit); - return cdhash_cmp(comp1->real, comp2->real) && cdhash_cmp(comp1->imag, comp2->imag); + return cdhash_cmp(comp1->real, comp2->real) || cdhash_cmp(comp1->imag, comp2->imag); } else { UNREACHABLE_RETURN(-1); |