]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: remove the unnecessary checks for null 18636/head
authorKefu Chai <kchai@redhat.com>
Tue, 31 Oct 2017 04:21:13 +0000 (12:21 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 31 Oct 2017 04:29:54 +0000 (12:29 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/osd/OSDMap.cc

index fc829dde69985a274bfc43327dd58f20b1eb136d..4cafc8e66e5dc8f5fe45806abe7a757ce9ecdd5f 100644 (file)
@@ -2070,10 +2070,8 @@ void OSDMap::pg_to_raw_osds(pg_t pg, vector<int> *raw, int *primary) const
 {
   const pg_pool_t *pool = get_pg_pool(pg.pool());
   if (!pool) {
-    if (primary)
-      *primary = -1;
-    if (raw)
-      raw->clear();
+    *primary = -1;
+    raw->clear();
     return;
   }
   _pg_to_raw_osds(*pool, pg, raw, NULL);
@@ -2084,10 +2082,8 @@ void OSDMap::pg_to_raw_up(pg_t pg, vector<int> *up, int *primary) const
 {
   const pg_pool_t *pool = get_pg_pool(pg.pool());
   if (!pool) {
-    if (primary)
-      *primary = -1;
-    if (up)
-      up->clear();
+    *primary = -1;
+    up->clear();
     return;
   }
   vector<int> raw;