mirror of
https://github.com/anope/anope.git
synced 2026-07-02 20:43:12 +02:00
Fix unnecessary uses of std::string.
This commit is contained in:
+2
-3
@@ -29,9 +29,8 @@ namespace Anope
|
||||
|
||||
if (leftover)
|
||||
{
|
||||
std::string extra;
|
||||
std::getline(tmp, extra);
|
||||
*leftover = extra;
|
||||
leftover->clear();
|
||||
std::getline(tmp, leftover->str());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -205,7 +205,7 @@ static Anope::string Hex(const char *data, size_t l)
|
||||
{
|
||||
const char hextable[] = "0123456789abcdef";
|
||||
|
||||
std::string rv;
|
||||
Anope::string rv;
|
||||
for (size_t i = 0; i < l; ++i)
|
||||
{
|
||||
unsigned char c = data[i];
|
||||
|
||||
+2
-2
@@ -106,7 +106,7 @@ bool sepstream::GetToken(Anope::string &token)
|
||||
if (!this->allow_empty)
|
||||
{
|
||||
this->pos = this->tokens.find_first_not_of(this->sep, this->pos);
|
||||
if (this->pos == std::string::npos)
|
||||
if (this->pos == Anope::string::npos)
|
||||
{
|
||||
this->pos = this->tokens.length() + 1;
|
||||
token.clear();
|
||||
@@ -115,7 +115,7 @@ bool sepstream::GetToken(Anope::string &token)
|
||||
}
|
||||
|
||||
size_t p = this->tokens.find(this->sep, this->pos);
|
||||
if (p == std::string::npos)
|
||||
if (p == Anope::string::npos)
|
||||
p = this->tokens.length();
|
||||
|
||||
token = this->tokens.substr(this->pos, p - this->pos);
|
||||
|
||||
+1
-1
@@ -202,7 +202,7 @@ bool IRCDProto::Format(Anope::string &message, const Anope::map<Anope::string> &
|
||||
|
||||
|
||||
const auto &last = params.back();
|
||||
if (last.empty() || last[0] == ':' || last.find(' ') != std::string::npos)
|
||||
if (last.empty() || last[0] == ':' || last.find(' ') != Anope::string::npos)
|
||||
buffer << ':';
|
||||
buffer << last;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ void Thread::Start()
|
||||
catch (const std::system_error &err)
|
||||
{
|
||||
this->flags[SF_DEAD] = true;
|
||||
throw CoreException("Unable to create thread: " + std::string(err.what()));
|
||||
throw CoreException("Unable to create thread: " + Anope::string(err.what()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user