mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
Major conversion of std::string API to const std::string &
This commit is contained in:
@@ -27,11 +27,11 @@ class classA {
|
||||
}
|
||||
}
|
||||
|
||||
bool hasProp(std::string key) const {
|
||||
bool hasProp(const std::string &key) const {
|
||||
return (dp_props.find(key) != dp_props.end());
|
||||
}
|
||||
|
||||
void setProp(std::string key, int val) {
|
||||
void setProp(const std::string &key, int val) {
|
||||
dp_props[key] = val;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class classC {
|
||||
}
|
||||
}
|
||||
|
||||
bool hasProp(std::string key) const {
|
||||
bool hasProp(const std::string &key) const {
|
||||
PAIR_VECT::const_iterator pvi;
|
||||
for (pvi = dp_props.begin(); pvi != dp_props.end(); pvi++) {
|
||||
if (pvi->first == key) {
|
||||
@@ -41,7 +41,7 @@ class classC {
|
||||
return false;
|
||||
}
|
||||
|
||||
void setProp(std::string key, int val) {
|
||||
void setProp(const std::string &key, int val) {
|
||||
std::pair<std::string, int> newp(key, val);
|
||||
dp_props.push_back(newp);
|
||||
}
|
||||
|
||||
@@ -27,11 +27,11 @@ class classA {
|
||||
}
|
||||
}
|
||||
|
||||
bool hasProp(std::string key) const {
|
||||
bool hasProp(const std::string &key) const {
|
||||
return (dp_props.find(key) != dp_props.end());
|
||||
}
|
||||
|
||||
void setProp(std::string key, int val) {
|
||||
void setProp(const std::string &key, int val) {
|
||||
dp_props[key] = val;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class classC {
|
||||
}
|
||||
}
|
||||
|
||||
bool hasProp(std::string key) const {
|
||||
bool hasProp(const std::string &key) const {
|
||||
PAIR_VECT::const_iterator pvi;
|
||||
for (pvi = dp_props.begin(); pvi != dp_props.end(); pvi++) {
|
||||
if (pvi->first == key) {
|
||||
@@ -41,7 +41,7 @@ class classC {
|
||||
return false;
|
||||
}
|
||||
|
||||
void setProp(std::string key, int val) {
|
||||
void setProp(const std::string &key, int val) {
|
||||
std::pair<std::string, int> newp(key, val);
|
||||
dp_props.push_back(newp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user