From: Danny Al-Gaaf Date: Tue, 16 Jun 2015 11:45:49 +0000 (+0200) Subject: ErasureCodeJerasure.cc: remove redundant checks before erase() X-Git-Tag: v9.1.0~446^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5dc028498ef46d4b3c333d3c90965d0409774955;p=ceph.git ErasureCodeJerasure.cc: remove redundant checks before erase() Fix for: [src/erasure-code/jerasure/ErasureCodeJerasure.cc:254]: (style) Redundant checking of STL container element existence before removing it. [src/erasure-code/jerasure/ErasureCodeJerasure.cc:493]: (style) Redundant checking of STL container element existence before removing it. [src/erasure-code/jerasure/ErasureCodeJerasure.cc:496]: (style) Redundant checking of STL container element existence before removing it. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/erasure-code/jerasure/ErasureCodeJerasure.cc b/src/erasure-code/jerasure/ErasureCodeJerasure.cc index eb10254c064..408f51f52e3 100644 --- a/src/erasure-code/jerasure/ErasureCodeJerasure.cc +++ b/src/erasure-code/jerasure/ErasureCodeJerasure.cc @@ -251,8 +251,7 @@ int ErasureCodeJerasureReedSolomonRAID6::parse(ErasureCodeProfile &profile, ostream *ss) { int err = ErasureCodeJerasure::parse(profile, ss); - if (profile.find("m") != profile.end()) - profile.erase("m"); + profile.erase("m"); m = 2; if (w != 8 && w != 16 && w != 32) { *ss << "ReedSolomonRAID6: w=" << w @@ -490,11 +489,9 @@ int ErasureCodeJerasureLiber8tion::parse(ErasureCodeProfile &profile, ostream *ss) { int err = ErasureCodeJerasure::parse(profile, ss); - if (profile.find("m") != profile.end()) - profile.erase("m"); + profile.erase("m"); err |= to_int("m", profile, &m, DEFAULT_M, ss); - if (profile.find("w") != profile.end()) - profile.erase("w"); + profile.erase("w"); err |= to_int("w", profile, &w, DEFAULT_W, ss); err |= to_int("packetsize", profile, &packetsize, DEFAULT_PACKETSIZE, ss);