]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ErasureCodeJerasure.cc: remove redundant checks before erase()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 16 Jun 2015 11:45:49 +0000 (13:45 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 17 Jul 2015 08:50:44 +0000 (10:50 +0200)
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 <danny.al-gaaf@bisect.de>
src/erasure-code/jerasure/ErasureCodeJerasure.cc

index eb10254c064cce4dc9f8623e6f89cbfaaf904063..408f51f52e3ed38afe53770096da944ae8247cd7 100644 (file)
@@ -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);