Skip to content

Commit b2fb226

Browse files
committed
Address comment: remove useless checked_cast
1 parent a8dbad9 commit b2fb226

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

cpp/src/arrow/compute/kernels/scalar_if_else.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,12 +1459,9 @@ struct CaseWhenFunction : ScalarFunction {
14591459
DCHECK(std::all_of(types.begin() + 1, types.end(), [](const TypeHolder& type) {
14601460
return is_decimal(type.id());
14611461
}));
1462-
const auto& ty1 = checked_cast<const DecimalType&>(*types[1].type);
14631462
return std::all_of(
1464-
types.begin() + 2, types.end(), [&ty1](const TypeHolder& type) {
1465-
const auto& ty = checked_cast<const DecimalType&>(*type.type);
1466-
return ty1.Equals(ty);
1467-
});
1463+
types.begin() + 2, types.end(),
1464+
[&types](const TypeHolder& type) { return type == types[1]; });
14681465
});
14691466
return constraint;
14701467
}

0 commit comments

Comments
 (0)