aboutsummaryrefslogtreecommitdiffstats
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorGravatar Attila Molnar2015-01-10 15:16:03 +0100
committerGravatar Attila Molnar2015-01-10 15:16:03 +0100
commit47dda4f61512f6047f2b1dcccd1943aab74726e3 (patch)
treea1425a9dbff58b97ef5dcdf169e0d65439513527 /src/channels.cpp
parentRemove the unused OnGlobalOper hook (diff)
downloadinspircd++-47dda4f61512f6047f2b1dcccd1943aab74726e3.tar.gz
inspircd++-47dda4f61512f6047f2b1dcccd1943aab74726e3.tar.bz2
inspircd++-47dda4f61512f6047f2b1dcccd1943aab74726e3.zip
Reduce std::string::substr() usage
substr() returns a new string while erase() and assign() modify the existing one
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 53a48c469..fdf0f76e1 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -396,10 +396,10 @@ bool Channel::CheckBan(User* user, const std::string& mask)
return false;
const std::string nickIdent = user->nick + "!" + user->ident;
- std::string prefix = mask.substr(0, at);
+ std::string prefix(mask, 0, at);
if (InspIRCd::Match(nickIdent, prefix, NULL))
{
- std::string suffix = mask.substr(at + 1);
+ std::string suffix(mask, at + 1);
if (InspIRCd::Match(user->host, suffix, NULL) ||
InspIRCd::Match(user->dhost, suffix, NULL) ||
InspIRCd::MatchCIDR(user->GetIPString(), suffix, NULL))