From 47dda4f61512f6047f2b1dcccd1943aab74726e3 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sat, 10 Jan 2015 15:16:03 +0100 Subject: Reduce std::string::substr() usage substr() returns a new string while erase() and assign() modify the existing one --- src/modes/cmode_k.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modes') diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp index 0f8070cb4..6738c046e 100644 --- a/src/modes/cmode_k.cpp +++ b/src/modes/cmode_k.cpp @@ -52,7 +52,7 @@ ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, s channel->SetMode(this, adding); if (adding) { - parameter = parameter.substr(0, 32); + parameter.erase(32); ext.set(channel, parameter); } else -- cgit v1.2.3