+ this->changed = false;
+ }
+
+ void InsertOrder(irc::string channel, int count)
+ {
+ /* This function figures out where in the sorted list to put an item from the hash */
+ SortedIter a;
+ for (a = so->begin(); a != so->end(); a++)
+ {
+ /* Found an item equal to or less than, we insert our item before it */
+ if (a->first <= count)
+ {
+ so->insert(a,std::pair<int,irc::string>(count,channel));
+ return;
+ }
+ }
+ /* There are no items in the list yet, insert something at the beginning */
+ so->insert(so->begin(), std::pair<int,irc::string>(count,channel));
+ }
+
+ void SortList()
+ {
+ /* Sorts the hash into the sorted list using an insertion sort */
+ so->clear();
+ for (StatsIter a = sh->begin(); a != sh->end(); a++)
+ {
+ log(DEBUG, "InsertOrder on %d %s",a->second,a->first.c_str());
+ InsertOrder(a->first, a->second);
+ }
+ this->changed = false;