Skip to content

Commit b25a6da

Browse files
mhaynieclaude
andcommitted
fix: Remove unnecessary lambda captures
Remove const/constexpr values from lambda capture lists since they don't need explicit capture (compiler handles them implicitly). Fixes -Wunused-lambda-capture warnings in Clang. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 2420fe3 commit b25a6da

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.config/git-hooks/git-hooks.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "lib/git-hooks.schema.json",
3+
"hooks": {
4+
"pre-commit": ["lib:block-master-commit"]
5+
}
6+
}

test/io_pipe_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ TEST_CASE("concurrent pipe operations", "[io][pipe]")
423423

424424
// Start writer threads
425425
for (int t = 0; t < num_threads; ++t) {
426-
writers.emplace_back([&pipe, &completed_writes, t, messages_per_thread]() {
426+
writers.emplace_back([&pipe, &completed_writes, t]() {
427427
for (int i = 0; i < messages_per_thread; ++i) {
428428
std::string message = "Thread" + std::to_string(t) + "Msg" + std::to_string(i) + "\n";
429429
auto bytes_written = pipe->in->write_async(message.data(), message.size()).get();
@@ -435,7 +435,7 @@ TEST_CASE("concurrent pipe operations", "[io][pipe]")
435435

436436
// Reader thread
437437
std::vector<std::string> received_messages;
438-
std::thread reader([&pipe, &received_messages, num_threads, messages_per_thread]() {
438+
std::thread reader([&pipe, &received_messages]() {
439439
std::string accumulated_data;
440440
char buffer[1024];
441441

test/math_random_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ TEST_CASE("get_random thread safety", "[math][random]")
260260
std::vector<std::vector<int>> thread_results(num_threads);
261261

262262
for (int t = 0; t < num_threads; ++t) {
263-
threads.emplace_back([&thread_results, t, values_per_thread]() {
263+
threads.emplace_back([&thread_results, t]() {
264264
for (int i = 0; i < values_per_thread; ++i) {
265265
thread_results[t].push_back(mh::get_random(1, 1000));
266266
}

0 commit comments

Comments
 (0)