Major conversion of std::string API to const std::string &

This commit is contained in:
Brian Kelley
2015-09-25 15:14:27 -04:00
parent 6ddc68bfba
commit 6ebbeb3bd3
42 changed files with 118 additions and 98 deletions

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -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);
}