Skip to content

Commit

Permalink
Remove unused variables in velox/expression/CastExpr-inl.h (#8773)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #8773

LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.

This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: palmje

Differential Revision: D53779591

fbshipit-source-id: 67b39c9f26a6cd6f783e7d621551cbfe158fe434
  • Loading branch information
r-barnes authored and facebook-github-bot committed Feb 16, 2024
1 parent c850581 commit 1649035
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions velox/expression/CastExpr-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,6 @@ void CastExpr::applyCastPrimitives(
auto* resultFlatVector = result->as<FlatVector<To>>();
auto* inputSimpleVector = input.as<SimpleVector<From>>();

auto& resultType = resultFlatVector->type();

if (!hooks_->truncate()) {
if (!hooks_->legacy()) {
applyToSelectedNoThrowLocal(context, rows, result, [&](int row) {
Expand Down

0 comments on commit 1649035

Please sign in to comment.