summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/rgw/rgw_role.cc11
-rw-r--r--src/rgw/rgw_role.h2
-rw-r--r--src/rgw/services/svc_role.h2
3 files changed, 6 insertions, 9 deletions
diff --git a/src/rgw/rgw_role.cc b/src/rgw/rgw_role.cc
index fe028f31597..af7f7f6f8fd 100644
--- a/src/rgw/rgw_role.cc
+++ b/src/rgw/rgw_role.cc
@@ -107,7 +107,7 @@ int RGWRole::delete_policy(const DoutPrefixProvider* dpp, const string& policy_n
} else {
perm_policy_map.erase(it);
}
- return 0;
+ return 0;
}
void RGWRole::dump(Formatter *f) const
@@ -176,12 +176,11 @@ bool RGWRole::validate_input(const DoutPrefixProvider* dpp)
return true;
}
-void RGWRole::extract_name_tenant(const std::string& str)
-{
- size_t pos = str.find('$');
- if (pos != std::string::npos) {
+void RGWRole::extract_name_tenant(const std::string& str) {
+ if (auto pos = str.find('$');
+ pos != std::string::npos) {
tenant = str.substr(0, pos);
- name = str.substr(pos + 1);
+ name = str.substr(pos+1);
}
}
diff --git a/src/rgw/rgw_role.h b/src/rgw/rgw_role.h
index ce29b9d7415..1523b6ecda3 100644
--- a/src/rgw/rgw_role.h
+++ b/src/rgw/rgw_role.h
@@ -63,7 +63,7 @@ public:
tags(std::move(tags)) {
if (this->path.empty())
this->path = "/";
- extract_name_tenant(this->name);
+ extract_name_tenant(name);
if (max_session_duration_str.empty()) {
max_session_duration = SESSION_DURATION_MIN;
} else {
diff --git a/src/rgw/services/svc_role.h b/src/rgw/services/svc_role.h
index 013c0ebb983..c33da97c1b8 100644
--- a/src/rgw/services/svc_role.h
+++ b/src/rgw/services/svc_role.h
@@ -19,8 +19,6 @@
#include "rgw/rgw_role.h"
#include "svc_meta_be.h"
-class RGWRole;
-
class RGWSI_Role: public RGWServiceInstance
{
public: