From 733e11d7de66c29c399ffa26b190624e476da619 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 31 Oct 2017 12:21:13 +0800 Subject: [PATCH] osd/OSDMap: remove the unnecessary checks for null Signed-off-by: Kefu Chai --- src/osd/OSDMap.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index fc829dde699..4cafc8e66e5 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -2070,10 +2070,8 @@ void OSDMap::pg_to_raw_osds(pg_t pg, vector *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 *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 raw;