diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-12-19 15:29:21 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-12-19 15:29:21 +0100 |
commit | 3ccf0065d43db80f31c6404aeac4d65551481508 (patch) | |
tree | a4e2dd2c7934ec9448362ebbbf51118958b3505b | |
parent | c44433dad279aa8ad95fc936ce5d3c671fbf9aa3 (diff) | |
parent | 64ccea389cc5a71badc9f8d0ea6731750ed4fde6 (diff) |
Merge branch 'master+listmode'
-rw-r--r-- | include/listmode.h | 2 | ||||
-rw-r--r-- | src/listmode.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/listmode.h b/include/listmode.h index 04044948c..94af1d524 100644 --- a/include/listmode.h +++ b/include/listmode.h @@ -37,7 +37,7 @@ class CoreExport ListModeBase : public ModeHandler /** Items stored in the channel's list */ - typedef std::list<ListItem> ModeList; + typedef std::vector<ListItem> ModeList; private: class ChanData diff --git a/src/listmode.cpp b/src/listmode.cpp index 19f2d6061..1147a4ef2 100644 --- a/src/listmode.cpp +++ b/src/listmode.cpp @@ -32,9 +32,9 @@ void ListModeBase::DisplayList(User* user, Channel* channel) ChanData* cd = extItem.get(channel); if (cd) { - for (ModeList::reverse_iterator it = cd->list.rbegin(); it != cd->list.rend(); ++it) + for (ModeList::const_iterator it = cd->list.begin(); it != cd->list.end(); ++it) { - user->WriteNumeric(listnumeric, "%s %s %s %lu", channel->name.c_str(), it->mask.c_str(), (!it->setter.empty() ? it->setter.c_str() : ServerInstance->Config->ServerName.c_str()), (unsigned long) it->time); + user->WriteNumeric(listnumeric, "%s %s %s %lu", channel->name.c_str(), it->mask.c_str(), it->setter.c_str(), (unsigned long) it->time); } } user->WriteNumeric(endoflistnumeric, "%s :%s", channel->name.c_str(), endofliststring.c_str()); @@ -192,7 +192,7 @@ ModeAction ListModeBase::OnModeChange(User* source, User*, Channel* channel, std { if (parameter == it->mask) { - cd->list.erase(it); + stdalgo::vector::swaperase(cd->list, it); return MODEACTION_ALLOW; } } |