Skip to content

Commit

Permalink
Remove unused exception parameter from velox/exec/Driver.cpp
Browse files Browse the repository at this point in the history
Summary:
`-Wunused-exception-parameter` has identified an unused exception parameter. This diff removes it.

This:
```
try {
    ...
} catch (exception& e) {
    // no use of e
}
```
should instead be written as
```
} catch (exception&) {
```

If the code compiles, this is safe to land.

Reviewed By: palmje

Differential Revision: D56724172

fbshipit-source-id: 41462ab2c0f028e68f10f4cc3953e5cb1cd5c27c
  • Loading branch information
r-barnes authored and facebook-github-bot committed Apr 30, 2024
1 parent 44e9ec1 commit ffc28ac
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion velox/exec/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ void Driver::enqueueInternal() {
auto stopGuard = folly::makeGuard([&]() { opCallStatus_.stop(); }); \
call; \
recordSilentThrows(*operatorPtr); \
} catch (const VeloxException& e) { \
} catch (const VeloxException&) { \
throw; \
} catch (const std::exception& e) { \
VELOX_FAIL( \
Expand Down
4 changes: 2 additions & 2 deletions velox/exec/HashProbe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,7 @@ void HashProbe::spillOutput(const std::vector<HashProbe*>& operators) {
// this runs.
try {
spillTask->move();
} catch (const std::exception& e) {
} catch (const std::exception&) {
}
}
});
Expand Down Expand Up @@ -1770,7 +1770,7 @@ SpillPartitionSet HashProbe::spillTable() {
// this runs.
try {
spillTask->move();
} catch (const std::exception& e) {
} catch (const std::exception&) {
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion velox/exec/tests/HashJoinTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ std::pair<int32_t, int32_t> numTaskSpillFiles(const exec::Task& task) {
void abortPool(memory::MemoryPool* pool) {
try {
VELOX_FAIL("Manual MemoryPool Abortion");
} catch (const VeloxException& error) {
} catch (const VeloxException&) {
pool->abort(std::current_exception());
}
}
Expand Down
2 changes: 1 addition & 1 deletion velox/exec/tests/JoinFuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ void JoinFuzzer::verify(core::JoinType joinType) {
VELOX_CHECK(
assertEqualResults({expected}, {actual}),
"Logically equivalent plans produced different results");
} catch (const VeloxException& e) {
} catch (const VeloxException&) {
LOG(ERROR) << "Expected\n"
<< expected->toString(0, expected->size()) << "\nActual\n"
<< actual->toString(0, actual->size());
Expand Down
6 changes: 3 additions & 3 deletions velox/expression/tests/ExpressionFuzzerVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ void ExpressionFuzzerVerifier::retryWithTry(
false, // canThrow
columnsToWrapInLazy)
.result;
} catch (const std::exception& e) {
} catch (const std::exception&) {
if (options_.findMinimalSubexpression) {
computeMinimumSubExpression(
{&execCtx_, {false, ""}},
Expand Down Expand Up @@ -281,7 +281,7 @@ void ExpressionFuzzerVerifier::retryWithTry(
: nullptr,
false, // canThrow
columnsToWrapInLazy);
} catch (const std::exception& e) {
} catch (const std::exception&) {
if (options_.findMinimalSubexpression) {
computeMinimumSubExpression(
{&execCtx_, {false, ""}},
Expand Down Expand Up @@ -339,7 +339,7 @@ void ExpressionFuzzerVerifier::go() {
resultVectors ? BaseVector::copy(*resultVectors) : nullptr,
true, // canThrow
columnsToWrapInLazy);
} catch (const std::exception& e) {
} catch (const std::exception&) {
if (options_.findMinimalSubexpression) {
computeMinimumSubExpression(
{&execCtx_, {false, ""}},
Expand Down
2 changes: 1 addition & 1 deletion velox/expression/tests/ExpressionVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ class MinimalSubExpressionFinder {
results ? BaseVector::copy(*results) : nullptr,
true, // canThrow
columnsToWrapInLazy);
} catch (const std::exception& e) {
} catch (const std::exception&) {
success = false;
}
FLAGS_minloglevel = 0;
Expand Down
12 changes: 6 additions & 6 deletions velox/functions/lib/Re2Functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class Re2MatchConstantPattern final : public exec::VectorFunction {
exec::LocalDecodedVector toSearch(context, *args[0], rows);
try {
checkForBadPattern(re_);
} catch (const std::exception& e) {
} catch (const std::exception&) {
context.setErrors(rows, std::current_exception());
return;
}
Expand Down Expand Up @@ -288,7 +288,7 @@ class Re2SearchAndExtractConstantPattern final : public exec::VectorFunction {
// apply() will not be invoked if the selection is empty.
try {
checkForBadPattern(re_);
} catch (const std::exception& e) {
} catch (const std::exception&) {
context.setErrors(rows, std::current_exception());
return;
}
Expand All @@ -312,7 +312,7 @@ class Re2SearchAndExtractConstantPattern final : public exec::VectorFunction {
if (const auto groupId = getIfConstant<T>(*args[2])) {
try {
checkForBadGroupId(*groupId, re_);
} catch (const std::exception& e) {
} catch (const std::exception&) {
context.setErrors(rows, std::current_exception());
return;
}
Expand Down Expand Up @@ -825,7 +825,7 @@ class LikeWithRe2 final : public exec::VectorFunction {
// apply() will not be invoked if the selection is empty.
try {
checkForBadPattern(*re_);
} catch (const std::exception& e) {
} catch (const std::exception&) {
context.setErrors(rows, std::current_exception());
return;
}
Expand Down Expand Up @@ -1058,7 +1058,7 @@ class Re2ExtractAllConstantPattern final : public exec::VectorFunction {
VELOX_CHECK(args.size() == 2 || args.size() == 3);
try {
checkForBadPattern(re_);
} catch (const std::exception& e) {
} catch (const std::exception&) {
context.setErrors(rows, std::current_exception());
return;
}
Expand All @@ -1083,7 +1083,7 @@ class Re2ExtractAllConstantPattern final : public exec::VectorFunction {
//
try {
checkForBadGroupId(*_groupId, re_);
} catch (const std::exception& e) {
} catch (const std::exception&) {
context.setErrors(rows, std::current_exception());
return;
}
Expand Down
4 changes: 2 additions & 2 deletions velox/functions/prestosql/benchmarks/URLBenchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ struct FollyUrlExtractPortFunction {
result = parsedUrl.port();
} catch (const folly::ConversionError&) {
return false;
} catch (const std::invalid_argument& e) {
} catch (const std::invalid_argument&) {
return false;
}
return true;
Expand All @@ -154,7 +154,7 @@ struct FollyUrlExtractParameterFunction {
strncpy(result.data(), pair.second.c_str(), pair.second.length());
}
}
} catch (const std::invalid_argument& e) {
} catch (const std::invalid_argument&) {
return false;
}
return false;
Expand Down

0 comments on commit ffc28ac

Please sign in to comment.