Merge pull request #18636 from tchaikov/wip-osdmap-cleanup

osd/OSDMap: remove the unnecessary checks for null

Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Kefu Chai 2017-11-01 10:48:56 +08:00 committed by GitHub
commit 8818a1939d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
@ -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;