зеркало из https://github.com/github/ruby.git
cdhash_cmp: should use ||
cf: https://github.com/ruby/ruby/pull/4469#discussion_r628386707
This commit is contained in:
Родитель
e1eff837cf
Коммит
0ab0b86c84
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче