From: Danny Al-Gaaf Date: Tue, 31 Jan 2017 13:36:58 +0000 (+0100) Subject: rgw/rgw_token.h: remove redundant and slow call to c_str() X-Git-Tag: v12.0.1~462^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=249832b72c3b1f341a3cb51cfd21e5ef47f2d571;p=ceph.git rgw/rgw_token.h: remove redundant and slow call to c_str() Do not call c_str() if the parameter is already of type string. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/rgw/rgw_token.h b/src/rgw/rgw_token.h index b13fe468634..9235f54b841 100644 --- a/src/rgw/rgw_token.h +++ b/src/rgw/rgw_token.h @@ -109,7 +109,7 @@ namespace rgw { ::decode(name, bl); ::decode(version, bl); ::decode(typestr, bl); - type = to_type(typestr.c_str()); + type = to_type(typestr); ::decode(id, bl); ::decode(key, bl); DECODE_FINISH(bl); @@ -135,7 +135,7 @@ namespace rgw { string typestr; JSONDecoder::decode_json("version", version, obj); JSONDecoder::decode_json("type", typestr, obj); - type = to_type(typestr.c_str()); + type = to_type(typestr); JSONDecoder::decode_json("id", id, obj); JSONDecoder::decode_json("key", key, obj); }