suppressed a few wasteful string-cstr conversions

This commit is contained in:
dockes 2008-07-01 11:57:36 +00:00
parent 022e0e5f43
commit ffd185c220
4 changed files with 12 additions and 12 deletions

View File

@ -88,7 +88,7 @@ const string &BincStream::str(void) const
//------------------------------------------------------------------------
void BincStream::clear(void)
{
nstr = "";
nstr.clear();
}
//------------------------------------------------------------------------

View File

@ -207,7 +207,7 @@ namespace Binc {
if (delim.find(*i) != std::string::npos) {
if (!skipempty || token != "")
dest.push_back(token);
token = "";
token.clear();
} else
token += *i;
}
@ -230,7 +230,7 @@ namespace Binc {
if (!inquote && delim.find(*i) != std::string::npos) {
if (!skipempty || token != "")
dest.push_back(token);
token = "";
token.clear();
} else
token += *i;
}
@ -241,13 +241,13 @@ namespace Binc {
//----------------------------------------------------------------------
inline std::string toCanonMailbox(const std::string &s_in)
{
if (s_in.find("..") != std::string::npos) return "";
if (s_in.find("..") != std::string::npos) return string();
if (s_in.length() >= 5) {
std::string a = s_in.substr(0, 5);
uppercase(a);
return a == "INBOX" ?
a + (s_in.length() > 5 ? s_in.substr(5) : "") : s_in;
a + (s_in.length() > 5 ? s_in.substr(5) : string() : s_in;
}
return s_in;

View File

@ -126,21 +126,21 @@ int Binc::MimePart::parseOnlyHeader(const string &toboundary) const
mimeSource->ungetChar();
quit = true;
name = "";
name.clear();
break;
}
name += c;
if (name.length() == 2 && name.substr(0, 2) == "\r\n") {
name = "";
name.clear();
quit = true;
break;
}
}
if (name.length() == 1 && name[0] == '\r') {
name = "";
name.clear();
break;
}
@ -175,7 +175,7 @@ int Binc::MimePart::parseOnlyHeader(const string &toboundary) const
h.add(name, content);
name = c;
content = "";
content.clear();
break;
}
}

View File

@ -107,7 +107,7 @@ void Binc::MimePart::printHeader(int fd, IODevice &output,
// abort printing of header. note that in this case, the
// headers will not end with a seperate \r\n.
quit = true;
name = "";
name.clear();
break;
}
}
@ -163,8 +163,8 @@ void Binc::MimePart::printHeader(int fd, IODevice &output,
}
// move on to the next header
content = "";
name = "";
content.clear();
name.clear();
break;
}