]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: constify _get_moncommand
authorSage Weil <sage@redhat.com>
Wed, 19 Jul 2017 20:57:16 +0000 (16:57 -0400)
committerJohn Spray <john.spray@redhat.com>
Wed, 19 Jul 2017 21:21:24 +0000 (17:21 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/Monitor.cc
src/mon/Monitor.h

index 29da4cd4c47deba01e9016a27a7821bd512a9514..86cfa91e6b3845ed1322974a5bfb1d4a2b3f5415 100644 (file)
@@ -2810,11 +2810,13 @@ void Monitor::_generate_command_map(map<string,cmd_vartype>& cmdmap,
   }
 }
 
-const MonCommand *Monitor::_get_moncommand(const string &cmd_prefix,
-                                           MonCommand *cmds, int cmds_size)
+const MonCommand *Monitor::_get_moncommand(
+  const string &cmd_prefix,
+  const MonCommand *cmds,
+  int cmds_size)
 {
-  MonCommand *this_cmd = NULL;
-  for (MonCommand *cp = cmds;
+  const MonCommand *this_cmd = NULL;
+  for (const MonCommand *cp = cmds;
        cp < &cmds[cmds_size]; cp++) {
     if (cp->cmdstring.compare(0, cmd_prefix.size(), cmd_prefix) == 0) {
       this_cmd = cp;
index 7bed317ddf0191f7d80b4e429e4b54be3d3248d5..fafadada9984c96007bd8caa86f6dc1bcd74d996 100644 (file)
@@ -685,8 +685,10 @@ public:
 
   static void _generate_command_map(map<string,cmd_vartype>& cmdmap,
                                     map<string,string> &param_str_map);
-  static const MonCommand *_get_moncommand(const string &cmd_prefix,
-                                           MonCommand *cmds, int cmds_size);
+  static const MonCommand *_get_moncommand(
+    const string &cmd_prefix,
+    const MonCommand *cmds,
+    int cmds_size);
   bool _allowed_command(MonSession *s, string &module, string &prefix,
                         const map<string,cmd_vartype>& cmdmap,
                         const map<string,string>& param_str_map,