Source: Remove redundant lambda parameter lists

This commit is contained in:
Dr. Dystopia
2025-04-28 22:02:56 +02:00
parent 95f6c76713
commit ca8f9b672b
54 changed files with 108 additions and 111 deletions

View File

@ -24,8 +24,8 @@ TEST(BlockingLoop, MultiThreaded)
// Must not block as the loop is stopped.
loop.Wait();
std::thread loop_thread([&]() {
loop.Run([&]() {
std::thread loop_thread([&] {
loop.Run([&] {
received_a.store(signaled_a.load());
received_b.store(signaled_b.load());
});
@ -39,7 +39,7 @@ TEST(BlockingLoop, MultiThreaded)
EXPECT_EQ(signaled_a.load(), received_a.load());
EXPECT_EQ(signaled_b.load(), received_b.load());
std::thread run_a_thread([&]() {
std::thread run_a_thread([&] {
for (int j = 0; j < 100; j++)
{
for (int k = 0; k < 100; k++)
@ -52,7 +52,7 @@ TEST(BlockingLoop, MultiThreaded)
EXPECT_EQ(signaled_a.load(), received_a.load());
}
});
std::thread run_b_thread([&]() {
std::thread run_b_thread([&] {
for (int j = 0; j < 100; j++)
{
for (int k = 0; k < 100; k++)

View File

@ -16,7 +16,7 @@ TEST(BusyLoopTest, MultiThreaded)
for (int i = 0; i < 10; i++)
{
loop.Prepare();
std::thread loop_thread([&]() { loop.Run([&]() { e.Set(); }); });
std::thread loop_thread([&] { loop.Run([&] { e.Set(); }); });
// Ping - Pong
for (int j = 0; j < 10; j++)

View File

@ -14,7 +14,7 @@ TEST(Event, MultiThreaded)
int shared_obj;
constexpr int ITERATIONS_COUNT = 100000;
auto sender = [&]() {
auto sender = [&] {
for (int i = 0; i < ITERATIONS_COUNT; ++i)
{
can_send.Wait();
@ -23,7 +23,7 @@ TEST(Event, MultiThreaded)
}
};
auto receiver = [&]() {
auto receiver = [&] {
for (int i = 0; i < ITERATIONS_COUNT; ++i)
{
has_sent.Wait();

View File

@ -36,7 +36,7 @@ TEST(Flag, MultiThreaded)
int count = 0;
constexpr int ITERATIONS_COUNT = 100000;
auto setter = [&]() {
auto setter = [&] {
for (int i = 0; i < ITERATIONS_COUNT; ++i)
{
while (f.IsSet())
@ -45,7 +45,7 @@ TEST(Flag, MultiThreaded)
}
};
auto clearer = [&]() {
auto clearer = [&] {
for (int i = 0; i < ITERATIONS_COUNT; ++i)
{
while (!f.IsSet())
@ -72,7 +72,7 @@ TEST(Flag, SpinLock)
constexpr int ITERATIONS_COUNT = 5000;
constexpr int THREADS_COUNT = 50;
auto adder_func = [&]() {
auto adder_func = [&] {
for (int i = 0; i < ITERATIONS_COUNT; ++i)
{
// Acquire the spinlock.

View File

@ -61,7 +61,7 @@ TEST(SPSCQueue, MultiThreaded)
constexpr u32 reps = 100000;
auto inserter = [&]() {
auto inserter = [&] {
for (u32 i = 0; i != reps; ++i)
q.Push({sptr, i});
@ -71,7 +71,7 @@ TEST(SPSCQueue, MultiThreaded)
EXPECT_EQ(sptr.use_count(), 2);
};
auto popper = [&]() {
auto popper = [&] {
for (u32 i = 0; i != reps; ++i)
{
q.WaitForData();