github-actions[bot] commented on code in PR #26526:
URL: https://github.com/apache/doris/pull/26526#discussion_r1385170432


##########
be/test/vec/exec/delta_writer_v2_pool_test.cpp:
##########
@@ -56,21 +56,9 @@
     auto map = pool.get_or_create(load_id);
     EXPECT_EQ(1, pool.size());
     WriteRequest req;
-    auto writer = map->get_or_create(100, [&req]() {
-        DeltaWriterV2* writer;
-        static_cast<void>(DeltaWriterV2::open(&req, {}, &writer));
-        return writer;
-    });
-    auto writer2 = map->get_or_create(101, [&req]() {
-        DeltaWriterV2* writer;
-        static_cast<void>(DeltaWriterV2::open(&req, {}, &writer));
-        return writer;
-    });
-    auto writer3 = map->get_or_create(100, [&req]() {
-        DeltaWriterV2* writer;
-        static_cast<void>(DeltaWriterV2::open(&req, {}, &writer));
-        return writer;
-    });
+    auto writer = map->get_or_create(100, [&req]() { return 
DeltaWriterV2::open(&req, {}); });
+    auto writer2 = map->get_or_create(101, [&req]() { return 
DeltaWriterV2::open(&req, {}); });

Review Comment:
   warning: 101 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
       auto writer2 = map->get_or_create(101, [&req]() { return 
DeltaWriterV2::open(&req, {}); });
                                         ^
   ```
   



##########
be/test/vec/exec/delta_writer_v2_pool_test.cpp:
##########
@@ -56,21 +56,9 @@ TEST_F(DeltaWriterV2PoolTest, test_map) {
     auto map = pool.get_or_create(load_id);
     EXPECT_EQ(1, pool.size());
     WriteRequest req;
-    auto writer = map->get_or_create(100, [&req]() {
-        DeltaWriterV2* writer;
-        static_cast<void>(DeltaWriterV2::open(&req, {}, &writer));
-        return writer;
-    });
-    auto writer2 = map->get_or_create(101, [&req]() {
-        DeltaWriterV2* writer;
-        static_cast<void>(DeltaWriterV2::open(&req, {}, &writer));
-        return writer;
-    });
-    auto writer3 = map->get_or_create(100, [&req]() {
-        DeltaWriterV2* writer;
-        static_cast<void>(DeltaWriterV2::open(&req, {}, &writer));
-        return writer;
-    });
+    auto writer = map->get_or_create(100, [&req]() { return 
DeltaWriterV2::open(&req, {}); });

Review Comment:
   warning: 100 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
       auto writer = map->get_or_create(100, [&req]() { return 
DeltaWriterV2::open(&req, {}); });
                                        ^
   ```
   



##########
be/test/vec/exec/delta_writer_v2_pool_test.cpp:
##########
@@ -56,21 +56,9 @@
     auto map = pool.get_or_create(load_id);
     EXPECT_EQ(1, pool.size());
     WriteRequest req;
-    auto writer = map->get_or_create(100, [&req]() {
-        DeltaWriterV2* writer;
-        static_cast<void>(DeltaWriterV2::open(&req, {}, &writer));
-        return writer;
-    });
-    auto writer2 = map->get_or_create(101, [&req]() {
-        DeltaWriterV2* writer;
-        static_cast<void>(DeltaWriterV2::open(&req, {}, &writer));
-        return writer;
-    });
-    auto writer3 = map->get_or_create(100, [&req]() {
-        DeltaWriterV2* writer;
-        static_cast<void>(DeltaWriterV2::open(&req, {}, &writer));
-        return writer;
-    });
+    auto writer = map->get_or_create(100, [&req]() { return 
DeltaWriterV2::open(&req, {}); });
+    auto writer2 = map->get_or_create(101, [&req]() { return 
DeltaWriterV2::open(&req, {}); });
+    auto writer3 = map->get_or_create(100, [&req]() { return 
DeltaWriterV2::open(&req, {}); });

Review Comment:
   warning: 100 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
       auto writer3 = map->get_or_create(100, [&req]() { return 
DeltaWriterV2::open(&req, {}); });
                                         ^
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to