aboutsummaryrefslogtreecommitdiffstats
path: root/src/mode.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/mode.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/mode.cpp')
-rw-r--r--src/mode.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 335bb85ce..671b5d854 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -218,7 +218,7 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, Mode
std::string& parameter = mcitem.param;
// crop mode parameter size to 250 characters
if (parameter.length() > 250 && adding)
- parameter = parameter.substr(0, 250);
+ parameter.erase(250);
ModResult MOD_RESULT;
FIRST_MOD_RESULT(OnRawMode, MOD_RESULT, (user, chan, mh, parameter, adding));