]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/options.h: Do not use linked lists of pointers 17984/head
authorAdam C. Emerson <aemerson@redhat.com>
Tue, 26 Sep 2017 22:37:31 +0000 (18:37 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Tue, 26 Sep 2017 22:37:31 +0000 (18:37 -0400)
Especially since we're just pushing things in from the end. The linked
list has more overhead, is slower, and adds no capability.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/common/options.h

index 01bc61e9e4b2d08350bac25c2454f9397f300f73..b8e877069587a5ff8423cfd202d6c6a10d31cf4e 100644 (file)
@@ -4,7 +4,7 @@
 #pragma once
 
 #include <string>
-#include <list>
+#include <vector>
 #include <boost/variant.hpp>
 #include "include/str_list.h"
 #include "msg/msg_types.h"
@@ -79,19 +79,19 @@ struct Option {
   // Additionally: "common" for settings that exist in any Ceph code.  Do
   // not use common for settings that are just shared some places: for those
   // places, list them.
-  std::list<const char*> services;
+  std::vector<const char*> services;
 
   // Topics like:
   // "service": a catchall for the boring stuff like log/asok paths.
   // "network"
   // "performance": a setting that may need adjustment depending on
   //                environment/workload to get best performance.
-  std::list<const char*> tags;
+  std::vector<const char*> tags;
 
-  std::list<const char*> see_also;
+  std::vector<const char*> see_also;
 
   value_t min, max;
-  std::list<std::string> enum_allowed;
+  std::vector<std::string> enum_allowed;
 
   bool safe;
 
@@ -233,7 +233,7 @@ struct Option {
     return *this;
   }
 
-  Option& set_enum_allowed(const std::list<std::string> allowed)
+  Option& set_enum_allowed(const std::vector<std::string> allowed)
   {
     enum_allowed = allowed;
     return *this;