Skip to content

Commit 7a05872

Browse files
committed
removing separate if block for complex arrays, compareComplex is promotable for arrays
1 parent f4df23c commit 7a05872

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

modules/packages/UnitTest.chpl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -538,12 +538,10 @@ module UnitTest {
538538
}
539539

540540
if equalNan {
541-
if isComplexType(T) {
541+
if isComplexType(T) ||
542+
(isArrayType(T) && isComplexType(actual.eltType)) {
542543
return compareComplex(actual, expected);
543544
}
544-
if isArrayType(T) && isComplexType(actual.eltType) {
545-
return [(a, e) in zip(actual, expected)] compareComplex(a, e);
546-
}
547545
if isImagType(T) || (isArrayType(T) && isImagType(actual.eltType)) {
548546
// no imaginary NaN, must cast to real
549547
return compareNanTrue(actual:real, expected:real);

0 commit comments

Comments
 (0)