Skip to content

Commit

Permalink
Merge pull request #18636 from tchaikov/wip-osdmap-cleanup
Browse files Browse the repository at this point in the history
osd/OSDMap: remove the unnecessary checks for null

Reviewed-by: Sage Weil <sage@redhat.com>
  • Loading branch information
tchaikov committed Nov 1, 2017
2 parents 0827af8 + 733e11d commit 8818a19
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/osd/OSDMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2051,10 +2051,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);
Expand All @@ -2065,10 +2063,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;
Expand Down

0 comments on commit 8818a19

Please sign in to comment.