From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 16:30:54 +0000 (+0100) Subject: crush/CrushWrapper.cc: don't pass c_str() result to std::string argument X-Git-Tag: v0.58~66^2~29 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f4cae0005268d737890ec7db63c09caf138ec625;p=ceph.git crush/CrushWrapper.cc: don't pass c_str() result to std::string argument 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 --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index a22f23509c9a..53e3c1cc6495 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -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 }