diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-01-10 15:16:03 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-01-10 15:16:03 +0100 |
commit | 47dda4f61512f6047f2b1dcccd1943aab74726e3 (patch) | |
tree | a1425a9dbff58b97ef5dcdf169e0d65439513527 /src/coremods | |
parent | ae10286658d6bb70e5e22526a004ec1b233f6fba (diff) |
Reduce std::string::substr() usage
substr() returns a new string while erase() and assign() modify the existing one
Diffstat (limited to 'src/coremods')
-rw-r--r-- | src/coremods/core_oper/cmd_rehash.cpp | 2 | ||||
-rw-r--r-- | src/coremods/core_whois.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/coremods/core_oper/cmd_rehash.cpp b/src/coremods/core_oper/cmd_rehash.cpp index 48dfa6fb1..19d2fa8c2 100644 --- a/src/coremods/core_oper/cmd_rehash.cpp +++ b/src/coremods/core_oper/cmd_rehash.cpp @@ -55,7 +55,7 @@ CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, Use // the leading "-" is optional; remove it if present. if (param[0] == '-') - param = param.substr(1); + param.erase(param.begin()); FOREACH_MOD(OnModuleRehash, (user, param)); return CMD_SUCCESS; diff --git a/src/coremods/core_whois.cpp b/src/coremods/core_whois.cpp index 966c4a790..7464e0527 100644 --- a/src/coremods/core_whois.cpp +++ b/src/coremods/core_whois.cpp @@ -96,7 +96,7 @@ void CommandWhois::SplitChanList(User* source, User* dest, const std::string& cl line = prefix.str(); } - line.append(cl.substr(start, pos - start + 1)); + line.append(cl, start, pos - start + 1); } if (line.length() != prefix.str().length()) |