suppressed a few wasteful string-cstr conversions

This commit is contained in:
dockes
2008-07-01 11:51:51 +00:00
parent 0460f1016c
commit 022e0e5f43
14 changed files with 78 additions and 71 deletions
+4 -4
View File
@@ -62,7 +62,7 @@ Address::Address(const string &wholeaddress)
if (start != string::npos)
name = wholeaddress.substr(0, start);
else
name = "";
name = string();
trim(name);
trim(name, "\"");
@@ -79,11 +79,11 @@ Address::Address(const string &wholeaddress)
string Address::toParenList(void) const
{
string tmp = "(";
tmp += name == "" ? "NIL" : toImapString(name);
tmp += name.empty() ? "NIL" : toImapString(name);
tmp += " NIL ";
tmp += local == "" ? "\"\"" : toImapString(local);
tmp += local.empty() ? "\"\"" : toImapString(local);
tmp += " ";
tmp += host == "" ? "\"\"" : toImapString(host);
tmp += host.empty() ? "\"\"" : toImapString(host);
tmp += ")";
return tmp;