]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMonitor.cc: assign result directly
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 23 Sep 2015 09:52:27 +0000 (11:52 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 29 Jan 2016 20:51:17 +0000 (21:51 +0100)
Fix for:

[src/mon/PGMonitor.cc:1514] -> [src/mon/PGMonitor.cc:1515]: (performance)
 Variable 'pool' is reassigned a value before the old one has been used.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/mon/PGMonitor.cc

index f9c61b7e9c27c3ffa5048f85772e0f6d87f1f5d9..98ffb8b5803846dae68c7f3bac59ad7f53c8753d 100644 (file)
@@ -1604,8 +1604,7 @@ bool PGMonitor::preprocess_command(MonOpRequestRef op)
     prefix = "pg ls";
     string poolstr;
     cmd_getval(g_ceph_context, cmdmap, "poolstr", poolstr);
-    int64_t pool = -2;
-    pool = mon->osdmon()->osdmap.lookup_pg_pool_name(poolstr.c_str());
+    int64_t pool = mon->osdmon()->osdmap.lookup_pg_pool_name(poolstr.c_str());
     if (pool < 0) {
       r = -ENOENT;
       ss << "pool " << poolstr << " does not exist";