From: Jiaying Ren Date: Tue, 2 May 2017 04:07:26 +0000 (+0800) Subject: rgw: lc cleanup homebrewed split with boost::split X-Git-Tag: v12.0.3~32^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0211d1ab2c25ca2e69a7f3c1ef4b6aa1b54185ca;p=ceph.git rgw: lc cleanup homebrewed split with boost::split Signed-off-by: Jiaying Ren --- diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index 403edbd4653..b70d2596f26 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -2,6 +2,9 @@ #include #include +#include +#include + #include "common/Formatter.h" #include #include "auth/Crypto.h" @@ -197,21 +200,6 @@ bool RGWLC::if_already_run_today(time_t& start_date) return false; } -static std::vector &split(const std::string &s, char delim, std::vector &elems) { - std::stringstream ss(s); - std::string item; - while (std::getline(ss, item, delim)) { - elems.push_back(item); - } - return elems; -} - -static std::vector split(const std::string &s, char delim) { - std::vector elems; - split(s, delim, elems); - return elems; -} - int RGWLC::bucket_lc_prepare(int index) { map entries; @@ -323,7 +311,7 @@ int RGWLC::bucket_lc_process(string& shard_id) vector objs; RGWObjectCtx obj_ctx(store); vector result; - result = split(shard_id, ':'); + boost::split(result, shard_id, boost::is_any_of(":")); string bucket_tenant = result[0]; string bucket_name = result[1]; string bucket_id = result[2];