Skip to content

Commit

Permalink
apacheGH-40983: [C++] Fix unused function build error (apache#40984)
Browse files Browse the repository at this point in the history
### Rationale for this change

Make sure local `CompressedInputArguments` is only defined when it's being used.

### What changes are included in this PR?

Wrapping definition and usage under the same `#ifdef`.

### Are these changes tested?

By building with `-Werror` and running all existing tests.
* GitHub Issue: apache#40983

Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Signed-off-by: mwish <maplewish117@gmail.com>
  • Loading branch information
felipecrv authored Apr 3, 2024
1 parent e0d73c5 commit 8c09c7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/src/arrow/io/compressed_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ static void CompressedInputStreamNonZeroCopyBufferReturnedByCallee(
BufferReadMode::ReturnedByCallee>(state, kCompression);
}

#ifdef ARROW_WITH_LZ4
static void CompressedInputArguments(::benchmark::internal::Benchmark* b) {
b->ArgNames({"num_bytes", "batch_size"})
->Args({8 * 1024, 8 * 1024})
Expand All @@ -180,7 +181,6 @@ static void CompressedInputArguments(::benchmark::internal::Benchmark* b) {
->Args({1024 * 1024, 1024 * 1024});
}

#ifdef ARROW_WITH_LZ4
// Benchmark LZ4 because it's lightweight, which makes benchmarking focused on the
// overhead of the compression input stream.
BENCHMARK_TEMPLATE(CompressedInputStreamZeroCopyBufferProvidedByCaller,
Expand Down

0 comments on commit 8c09c7f

Please sign in to comment.