Skip to content

Commit

Permalink
Remove unused-variable in /fbcode/dwio/catalog/AuditLogger.cpp (#104)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #104

[codemod] Remove unused-variable in {filename}

LLVM-15 has a warning `-Wunused-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]]`.

#buildsonlynotests - Builds are sufficient to verify
 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: palmje

Differential Revision: D65445300

fbshipit-source-id: 079b5378fc2293e5288d641d04731700e3229819
  • Loading branch information
r-barnes authored and facebook-github-bot committed Nov 9, 2024
1 parent 60ffa3b commit fd7fee7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion dwio/nimble/encodings/tests/TestGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ void writeFile(
std::ofstream file{
fmt::format("{}/{}.data", path, identifier),
std::ios::out | std::ios::binary | std::ios::trunc};
auto count = data.size();
for (const auto& value : data) {
if constexpr (std::is_same_v<std::string_view, typename E::cppDataType>) {
auto size = value.size();
Expand Down
2 changes: 1 addition & 1 deletion dwio/nimble/tablet/tests/TabletTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ TEST(TabletTests, OptionalSectionsPreload) {
LOG(INFO) << "seed: " << seed;
std::mt19937 rng{seed};

for (const auto footerCompressionThreshold :
for ([[maybe_unused]] const auto footerCompressionThreshold :
{0U, std::numeric_limits<uint32_t>::max()}) {
auto pool = velox::memory::deprecatedAddDefaultLeafMemoryPool();
std::string file;
Expand Down
1 change: 0 additions & 1 deletion dwio/nimble/velox/tests/TypeTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ TEST_F(TypeTests, FlatMapFeatureSelection) {

for (auto i = 0; i < batchSize; ++i) {
for (auto j = 0; j < map->sizeAt(i); ++j) {
size_t idx = map->offsetAt(i) + j;
if (!values->isNullAt(i)) {
uniqueKeys.emplace(keys->valueAt(i));
}
Expand Down

0 comments on commit fd7fee7

Please sign in to comment.