]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Change a few bits to use std::list instead of std::vector.
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 28 Dec 2008 03:27:28 +0000 (03:27 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 28 Dec 2008 03:27:28 +0000 (03:27 +0000)
Vector is better than list, unless:
 - you require random access (these don't)
 - you require that the memory they are stored in are contiguous (these don't)
This will save a couple of bytes here and there perhaps (along with
much less problems with memory fragmentation and allocation).

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10923 e03df62e-2008-0410-955e-edbf42e46eb7

include/channels.h
include/inspircd.h
include/u_listmode.h

index 9c231008a3ce28cb8a9bfb079c1bc7120a5610af..748f6c24b9dcb043f9d37efd6ead2a6e2704c908 100644 (file)
@@ -58,7 +58,7 @@ class BanItem : public HostItem
 
 /** Holds a complete ban list
  */
-typedef std::vector<BanItem>   BanList;
+typedef std::list<BanItem>     BanList;
 
 /** A list of users on a channel
  */
index 85c2f62e625621ee4e30276fae789aa4cde14695..b55401e431c157da329f16aca8aac6595b376cd5 100644 (file)
@@ -42,6 +42,7 @@
 #include <sstream>
 #include <string>
 #include <vector>
+#include <list>
 #include <deque>
 #include <map>
 #include <bitset>
index 6e654f64faec1db62ced00e505438f78f4361506..738eddeb07ae160e093b04e608fee1b030e0cb31 100644 (file)
@@ -44,10 +44,10 @@ public:
 
 /** Items stored in the channel's list
  */
-typedef std::vector<ListItem> modelist;
+typedef std::list<ListItem> modelist;
 /** Max items per channel by name
  */
-typedef std::vector<ListLimit> limitlist;
+typedef std::list<ListLimit> limitlist;
 
 /** A request used to check if a user is on a channel's list or not
  */