diff options
| author | 2015-01-10 15:16:03 +0100 | |
|---|---|---|
| committer | 2015-01-10 15:16:03 +0100 | |
| commit | 47dda4f61512f6047f2b1dcccd1943aab74726e3 (patch) | |
| tree | a1425a9dbff58b97ef5dcdf169e0d65439513527 /src/modules/m_alias.cpp | |
| parent | Remove the unused OnGlobalOper hook (diff) | |
| download | inspircd++-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/modules/m_alias.cpp')
| -rw-r--r-- | src/modules/m_alias.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 20d3f5c45..5b3979179 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -148,7 +148,7 @@ class ModuleAlias : public Module return MOD_RES_PASSTHRU; /* The parameters for the command in their original form, with the command stripped off */ - std::string compare = original_line.substr(command.length()); + std::string compare(original_line, command.length()); while (*(compare.c_str()) == ' ') compare.erase(compare.begin()); @@ -212,7 +212,7 @@ class ModuleAlias : public Module return; /* The parameters for the command in their original form, with the command stripped off */ - std::string compare = text.substr(scommand.length() + 1); + std::string compare(text, scommand.length() + 1); while (*(compare.c_str()) == ' ') compare.erase(compare.begin()); |
