You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/06/26 03:33:36 UTC

[GitHub] [incubator-kvrocks] PragmaTwice commented on a diff in pull request #672: enhance: use unique_ptr in Config

PragmaTwice commented on code in PR #672:
URL: https://github.com/apache/incubator-kvrocks/pull/672#discussion_r906750050


##########
src/config.cc:
##########
@@ -84,11 +84,15 @@ const char *configEnumGetName(configEnum *ce, int val) {
 
 Config::Config() {
   struct FieldWrapper {
-    const char *name;
+    const std::string name;
     bool readonly;
-    ConfigField *field;
+    std::unique_ptr<ConfigField> field;
+
+    FieldWrapper(std::string name, bool readonly,
+                 ConfigField* field)
+        : name(std::move(name)), readonly(readonly), field(std::move(field)) {}

Review Comment:
   Applying `std::move` to a pointer `ConfigField* field` is useless.



-- 
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: issues-unsubscribe@kvrocks.apache.org

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