]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush/CrushWrapper.cc: don't pass c_str() result to std::string argument
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 16:30:54 +0000 (17:30 +0100)
committerGreg Farnum <greg@inktank.com>
Thu, 14 Feb 2013 18:27:38 +0000 (10:27 -0800)
Fix issue found by cppcheck:

[src/crush/CrushWrapper.cc:352]: (performance) Passing the result of
  c_str() to a function that takes std::string as argument no. 4 is
  slow and redundant.
[src/crush/CrushWrapper.cc:388]: (performance) Passing the result of
  c_str() to a function that takes std::string as argument no. 4 is
  slow and redundant.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/crush/CrushWrapper.cc

index a22f23509c9afe803864668c674079aa787e3288..53e3c1cc64951846794210c4c4a1690d5c7b98c2 100644 (file)
@@ -349,7 +349,7 @@ int CrushWrapper::create_or_move_item(CephContext *cct, int item, float weight,
     }
     ldout(cct, 5) << "create_or_move_item adding " << item << " weight " << weight
                  << " at " << loc << dendl;
-    ret = insert_item(cct, item, weight, name.c_str(), loc);
+    ret = insert_item(cct, item, weight, name, loc);
     if (ret == 0)
       ret = 1;  // changed
   }
@@ -385,7 +385,7 @@ int CrushWrapper::update_item(CephContext *cct, int item, float weight, string n
     }
     ldout(cct, 5) << "update_item adding " << item << " weight " << weight
                  << " at " << loc << dendl;
-    ret = insert_item(cct, item, weight, name.c_str(), loc);
+    ret = insert_item(cct, item, weight, name, loc);
     if (ret == 0)
       ret = 1;  // changed
   }