Skip to content

Commit 7496e27

Browse files
committed
more unused captures
Signed-off-by: Martijn Govers <[email protected]>
1 parent 0cfed9e commit 7496e27

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

power_grid_model_c/power_grid_model/include/power_grid_model/job_dispatch.hpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ class JobDispatch {
113113

114114
auto run = [&adapter, &result_data](Idx scenario_idx) { adapter.calculate(result_data, scenario_idx); };
115115

116-
auto calculate_scenario = JobDispatch::call_with<Idx>(std::move(run), std::move(setup), std::move(winddown),
117-
scenario_exception_handler(adapter, exceptions),
118-
std::move(recover_from_bad));
116+
auto calculate_scenario =
117+
JobDispatch::call_with<Idx>(std::move(run), std::move(setup), std::move(winddown),
118+
scenario_exception_handler(exceptions), std::move(recover_from_bad));
119119

120120
for (Idx scenario_idx = start; scenario_idx < n_scenarios; scenario_idx += stride) {
121121
Timer const t_total_single{thread_info, LogEvent::total_single_calculation_in_thread};
@@ -188,9 +188,8 @@ class JobDispatch {
188188
}
189189

190190
// Lippincott pattern
191-
template <typename Adapter>
192-
static auto scenario_exception_handler(Adapter& adapter, std::vector<std::string>& messages) {
193-
return [&adapter, &messages](Idx scenario_idx) {
191+
static auto scenario_exception_handler(std::vector<std::string>& messages) {
192+
return [&messages](Idx scenario_idx) {
194193
std::exception_ptr const ex_ptr = std::current_exception();
195194
try {
196195
std::rethrow_exception(ex_ptr);

tests/cpp_unit_tests/test_job_dispatch.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,9 @@ TEST_CASE("Test job dispatch logic") {
423423
}
424424
SUBCASE("Test scenario_exception_handler") {
425425
auto counter = std::make_shared<CallCounter>();
426-
auto adapter = JobAdapterMock{counter};
427426
Idx const n_scenarios = 11; // arbitrary non-zero value
428427
auto messages = std::vector<std::string>(n_scenarios, "");
429-
auto handler = JobDispatch::scenario_exception_handler(adapter, messages);
428+
auto handler = JobDispatch::scenario_exception_handler(messages);
430429
SUBCASE("Known exception") {
431430
std::string const expected_message = "Test exception";
432431
Idx const scenario_idx = 7; // arbitrary index

0 commit comments

Comments
 (0)