You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by "acelyc111 (via GitHub)" <gi...@apache.org> on 2023/05/18 06:53:29 UTC

[GitHub] [incubator-pegasus] acelyc111 commented on a diff in pull request #1480: refactor: remove some useless code

acelyc111 commented on code in PR #1480:
URL: https://github.com/apache/incubator-pegasus/pull/1480#discussion_r1197468996


##########
src/server/test/pegasus_server_test_base.h:
##########
@@ -77,14 +76,14 @@ class pegasus_server_test_base : public ::testing::Test
         // do not clear state
         _server->stop(false);
 
-        dsn::replication::destroy_replica_stub(_replica_stub);
-        dsn::replication::destroy_replica(_replica);
+        delete _replica_stub;
+        delete _replica;
     }
 
 protected:
     std::unique_ptr<mock_pegasus_server_impl> _server;
-    dsn::replication::replica *_replica;
-    dsn::replication::replica_stub *_replica_stub;
+    dsn::replication::replica *_replica = nullptr;
+    dsn::replication::replica_stub *_replica_stub = nullptr;

Review Comment:
   Good idea, but it will introduce more code changes if using unique_ptr. std::unique_ptr is not able to access the class replica's private constructor member.
   Because this is a patch to "remove codes", so we can do it in another PR.



-- 
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: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org