diff options
author | attilamolnar <attilamolnar@hush.com> | 2012-07-26 01:47:07 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2012-07-26 02:25:35 +0200 |
commit | bcd91de3474a166418ae3e0c6238f5cb41827531 (patch) | |
tree | b48d936d566fc2507d51a275969c2ccece9477e0 /src | |
parent | 7297c11c722ecf61b9e6a3e9b74becd69900b8d5 (diff) |
m_hostchange Remove string copy
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_hostchange.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp index 21623e51b..cc7c57508 100644 --- a/src/modules/m_hostchange.cpp +++ b/src/modules/m_hostchange.cpp @@ -147,15 +147,14 @@ class ModuleHostChange : public Module { // first take their nick and strip out non-dns, leaving just [A-Z0-9\-] std::string complete; - std::string old = user->nick; - for (unsigned int j = 0; j < old.length(); j++) + for (std::string::const_iterator j = user->nick.begin(); j != user->nick.end(); ++j) { - if (((old[j] >= 'A') && (old[j] <= 'Z')) || - ((old[j] >= 'a') && (old[j] <= 'z')) || - ((old[j] >= '0') && (old[j] <= '9')) || - (old[j] == '-')) + if (((*j >= 'A') && (*j <= 'Z')) || + ((*j >= 'a') && (*j <= 'z')) || + ((*j >= '0') && (*j <= '9')) || + (*j == '-')) { - complete = complete + old[j]; + complete = complete + *j; } } if (complete.empty()) |