]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rgw_token.h: remove redundant and slow call to c_str()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 31 Jan 2017 13:36:58 +0000 (14:36 +0100)
committerSage Weil <sage@redhat.com>
Thu, 9 Feb 2017 02:54:25 +0000 (21:54 -0500)
Do not call c_str() if the parameter is already of type string.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/rgw/rgw_token.h

index b13fe468634bcab15818a4032ac2b57dd7eb1725..9235f54b8416bb9f580dab859662ae650e1ffa9f 100644 (file)
@@ -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);
     }