aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_vhost.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2020-11-11 02:25:06 +0000
committerGravatar Sadie Powell2020-11-11 02:29:36 +0000
commit2d6d47b489d733ca3c29fc2f963d424029fcb929 (patch)
treefa38bdd2dcbebdb126d29482bfb7d5389a10c2d4 /src/modules/m_vhost.cpp
parentConvert FOREACH_MOD_CUSTOM to a variadic function. (diff)
Add stdalgo::equal_range and switch more stuff to iterator_range.
Diffstat (limited to 'src/modules/m_vhost.cpp')
-rw-r--r--src/modules/m_vhost.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/modules/m_vhost.cpp b/src/modules/m_vhost.cpp
index b5f47b7cd..615272ef0 100644
--- a/src/modules/m_vhost.cpp
+++ b/src/modules/m_vhost.cpp
@@ -48,7 +48,6 @@ struct CustomVhost
};
typedef std::multimap<std::string, CustomVhost> CustomVhostMap;
-typedef std::pair<CustomVhostMap::iterator, CustomVhostMap::iterator> MatchingConfigs;
/** Handle /VHOST
*/
@@ -65,11 +64,8 @@ class CommandVhost : public Command
CmdResult Handle(User* user, const Params& parameters) override
{
- MatchingConfigs matching = vhosts.equal_range(parameters[0]);
-
- for (MatchingConfigs::first_type i = matching.first; i != matching.second; ++i)
+ for (const auto& [_, config] : stdalgo::equal_range(vhosts, parameters[0]))
{
- CustomVhost config = i->second;
if (config.CheckPass(user, parameters[1]))
{
user->WriteNotice("Setting your VHost: " + config.vhost);