From: Yan Jun Date: Mon, 6 Jun 2016 15:31:19 +0000 (+0800) Subject: rgw/basic_type: use the standard usage of string X-Git-Tag: v11.0.0~226^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dc0ac7b30430243c0ab9e83bb58435c3b9936f8a;p=ceph.git rgw/basic_type: use the standard usage of string string::find() returns a value of size_t type, we'd better use the std::string::npos when it find nothing. Signed-off-by: Yan Jun --- diff --git a/src/rgw/rgw_basic_types.h b/src/rgw/rgw_basic_types.h index 00ad16e50aa7..d1c06d1bac78 100644 --- a/src/rgw/rgw_basic_types.h +++ b/src/rgw/rgw_basic_types.h @@ -52,8 +52,8 @@ struct rgw_user { } void from_str(const std::string& str) { - ssize_t pos = str.find('$'); - if (pos >= 0) { + size_t pos = str.find('$'); + if (pos != std::string::npos) { tenant = str.substr(0, pos); id = str.substr(pos + 1); } else {