| 384 | } |
| 385 | |
| 386 | static void ErrorSchemeResultNoInline( |
| 387 | benchmark::State& state) { // NOLINT non-const reference |
| 388 | auto integers = RandomIntegers(); |
| 389 | |
| 390 | for (auto _ : state) { |
| 391 | int64_t total = 0; |
| 392 | for (const auto v : integers) { |
| 393 | auto maybe_value = ErrorAsResultNoInline(v); |
| 394 | if (ARROW_PREDICT_TRUE(maybe_value.ok())) { |
| 395 | total = Accumulate(total, *std::move(maybe_value)); |
| 396 | } |
| 397 | } |
| 398 | benchmark::DoNotOptimize(total); |
| 399 | } |
| 400 | |
| 401 | state.SetItemsProcessed(state.iterations() * integers.size()); |
| 402 | } |
| 403 | |
| 404 | static void ErrorSchemeException(benchmark::State& state) { // NOLINT non-const reference |
| 405 | auto integers = RandomIntegers(); |
nothing calls this directly
no test coverage detected