X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmode.cpp;h=671b5d85456ddd44ec294a049c20d998e40c120b;hb=63aa8d0d42f619c52d382bde3e6ba2e5e23b12ac;hp=0d3de3890e2690ed44fea46eac7dff55ef668230;hpb=3a3ff949670c61a4a8856e1391222e156eb1cd17;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/mode.cpp b/src/mode.cpp index 0d3de3890..671b5d854 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -218,7 +218,7 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, Mode std::string& parameter = mcitem.param; // crop mode parameter size to 250 characters if (parameter.length() > 250 && adding) - parameter = parameter.substr(0, 250); + parameter.erase(250); ModResult MOD_RESULT; FIRST_MOD_RESULT(OnRawMode, MOD_RESULT, (user, chan, mh, parameter, adding)); @@ -268,8 +268,8 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, Mode } // Ask mode watchers whether this mode change is OK - std::pair itpair = modewatchermap.equal_range(mh->name); - for (ModeWatchIter i = itpair.first; i != itpair.second; ++i) + std::pair itpair = modewatchermap.equal_range(mh->name); + for (ModeWatcherMap::iterator i = itpair.first; i != itpair.second; ++i) { ModeWatcher* mw = i->second; if (mw->GetModeType() == type) @@ -320,7 +320,7 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, Mode return ma; itpair = modewatchermap.equal_range(mh->name); - for (ModeWatchIter i = itpair.first; i != itpair.second; ++i) + for (ModeWatcherMap::iterator i = itpair.first; i != itpair.second; ++i) { ModeWatcher* mw = i->second; if (mw->GetModeType() == type) @@ -496,8 +496,8 @@ void ModeParser::ShowListModeList(User* user, Channel* chan, ModeHandler* mh) bool display = true; // Ask mode watchers whether it's OK to show the list - std::pair itpair = modewatchermap.equal_range(mh->name); - for (ModeWatchIter i = itpair.first; i != itpair.second; ++i) + std::pair itpair = modewatchermap.equal_range(mh->name); + for (ModeWatcherMap::iterator i = itpair.first; i != itpair.second; ++i) { ModeWatcher* mw = i->second; if (mw->GetModeType() == MODETYPE_CHANNEL) @@ -790,7 +790,7 @@ std::string ModeParser::BuildPrefixes(bool lettersAndModes) { std::string mletters; std::string mprefixes; - std::map > prefixes; + insp::flat_map > prefixes; const PrefixModeList& list = GetPrefixModes(); for (PrefixModeList::const_iterator i = list.begin(); i != list.end(); ++i) @@ -800,7 +800,7 @@ std::string ModeParser::BuildPrefixes(bool lettersAndModes) prefixes[pm->GetPrefixRank()] = std::make_pair(pm->GetPrefix(), pm->GetModeChar()); } - for(std::map >::reverse_iterator n = prefixes.rbegin(); n != prefixes.rend(); n++) + for (insp::flat_map >::reverse_iterator n = prefixes.rbegin(); n != prefixes.rend(); ++n) { mletters = mletters + n->second.first; mprefixes = mprefixes + n->second.second; @@ -816,8 +816,8 @@ void ModeParser::AddModeWatcher(ModeWatcher* mw) bool ModeParser::DelModeWatcher(ModeWatcher* mw) { - std::pair itpair = modewatchermap.equal_range(mw->GetModeName()); - for (ModeWatchIter i = itpair.first; i != itpair.second; ++i) + std::pair itpair = modewatchermap.equal_range(mw->GetModeName()); + for (ModeWatcherMap::iterator i = itpair.first; i != itpair.second; ++i) { if (i->second == mw) {