Skip to content

Commit

Permalink
Merge pull request #18522 from C2python/cleanup_to_string
Browse files Browse the repository at this point in the history
rgw: Delete to_string functions. stringify defined in include/stringify.h can provide the same feature.

Reviewed-by: Adam Emerson <aemerson@redhat.com>
  • Loading branch information
cbodley committed Nov 3, 2017
2 parents 1145c38 + b1764bd commit 2079f8d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 35 deletions.
5 changes: 0 additions & 5 deletions src/rgw/rgw_basic_types.cc
Expand Up @@ -33,10 +33,5 @@ ostream& operator <<(ostream& m, const Principal& p) {
}
return m << (p.is_user() ? "user/" : "role/") << p.get_id();
}
string to_string(const Principal& p) {
stringstream s;
s << p;
return s.str();
}
}
}
1 change: 0 additions & 1 deletion src/rgw/rgw_basic_types.h
Expand Up @@ -177,7 +177,6 @@ class Principal {
};

std::ostream& operator <<(std::ostream& m, const Principal& p);
std::string to_string(const Principal& p);
}
}

Expand Down
24 changes: 0 additions & 24 deletions src/rgw/rgw_iam_policy.cc
Expand Up @@ -928,12 +928,6 @@ ostream& operator <<(ostream& m, const MaskedIP& ip) {
return m;
}

string to_string(const MaskedIP& m) {
stringstream ss;
ss << m;
return ss.str();
}

bool Condition::eval(const Environment& env) const {
auto i = env.find(key);
if (op == TokenID::Null) {
Expand Down Expand Up @@ -1219,12 +1213,6 @@ ostream& operator <<(ostream& m, const Condition& c) {
return m << "}";
}

string to_string(const Condition& c) {
stringstream ss;
ss << c;
return ss.str();
}

Effect Statement::eval(const Environment& e,
optional<const rgw::auth::Identity&> ida,
uint64_t act, const ARN& res) const {
Expand Down Expand Up @@ -1518,12 +1506,6 @@ ostream& operator <<(ostream& m, const Statement& s) {
return m << " }";
}

string to_string(const Statement& s) {
stringstream m;
m << s;
return m.str();
}

Policy::Policy(CephContext* cct, const string& tenant,
const bufferlist& _text)
: text(_text.to_str()) {
Expand Down Expand Up @@ -1574,11 +1556,5 @@ ostream& operator <<(ostream& m, const Policy& p) {
return m << " }";
}

string to_string(const Policy& p) {
stringstream s;
s << p;
return s.str();
}

}
}
5 changes: 0 additions & 5 deletions src/rgw/rgw_iam_policy.h
Expand Up @@ -247,7 +247,6 @@ struct MaskedIP {
};

std::ostream& operator <<(std::ostream& m, const MaskedIP& ip);
string to_string(const MaskedIP& m);

inline bool operator ==(const MaskedIP& l, const MaskedIP& r) {
auto shift = std::max((l.v6 ? 128 : 32) - l.prefix,
Expand Down Expand Up @@ -398,8 +397,6 @@ struct Condition {

std::ostream& operator <<(std::ostream& m, const Condition& c);

std::string to_string(const Condition& c);

struct Statement {
boost::optional<std::string> sid = boost::none;

Expand All @@ -424,7 +421,6 @@ struct Statement {
};

std::ostream& operator <<(ostream& m, const Statement& s);
std::string to_string(const Statement& s);

struct PolicyParseException : public std::exception {
rapidjson::ParseResult pr;
Expand Down Expand Up @@ -452,7 +448,6 @@ struct Policy {
};

std::ostream& operator <<(ostream& m, const Policy& p);
std::string to_string(const Policy& p);
}
}

Expand Down

0 comments on commit 2079f8d

Please sign in to comment.