summaryrefslogtreecommitdiff
path: root/src/modules/m_exemptchanops.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-01-10 15:16:03 +0100
committerAttila Molnar <attilamolnar@hush.com>2015-01-10 15:16:03 +0100
commit47dda4f61512f6047f2b1dcccd1943aab74726e3 (patch)
treea1425a9dbff58b97ef5dcdf169e0d65439513527 /src/modules/m_exemptchanops.cpp
parentae10286658d6bb70e5e22526a004ec1b233f6fba (diff)
Reduce std::string::substr() usage
substr() returns a new string while erase() and assign() modify the existing one
Diffstat (limited to 'src/modules/m_exemptchanops.cpp')
-rw-r--r--src/modules/m_exemptchanops.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/m_exemptchanops.cpp b/src/modules/m_exemptchanops.cpp
index 2d06b73a0..076445644 100644
--- a/src/modules/m_exemptchanops.cpp
+++ b/src/modules/m_exemptchanops.cpp
@@ -36,7 +36,7 @@ class ExemptChanOps : public ListModeBase
return false;
}
- std::string restriction = word.substr(0, p);
+ std::string restriction(word, 0, p);
// If there is a '-' in the restriction string ignore it and everything after it
// to support "auditorium-vis" and "auditorium-see" in m_auditorium
p = restriction.find('-');
@@ -98,7 +98,7 @@ class ExemptHandler : public HandlerBase3<ModResult, User*, Channel*, const std:
if (pos == std::string::npos)
continue;
if (!i->mask.compare(0, pos, restriction))
- minmode = (*i).mask.substr(pos + 1);
+ minmode.assign(i->mask, pos + 1, std::string::npos);
}
}