Skip to content

Commit

Permalink
Remove unused variables in velox/dwio/common/ReaderFactory.cpp (#8774)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #8774

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: D53779583

fbshipit-source-id: bde647c481c86cc81cbc6920fe0eac668147819e
  • Loading branch information
r-barnes authored and facebook-github-bot committed Feb 16, 2024
1 parent 4243a71 commit c850581
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion velox/dwio/common/ReaderFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ ReaderFactoriesMap& readerFactories() {
} // namespace

bool registerReaderFactory(std::shared_ptr<ReaderFactory> factory) {
bool ok = readerFactories().insert({factory->fileFormat(), factory}).second;
[[maybe_unused]] const bool ok =
readerFactories().insert({factory->fileFormat(), factory}).second;
// NOTE: re-enable this check after Prestissimo has updated dwrf registration.
#if 0
VELOX_CHECK(
Expand Down

0 comments on commit c850581

Please sign in to comment.