Use a set instead of a vector in CModule

CModule has two vectors: A list of timers and a list of sockets for this
module. Since one shouldn't be able to add items multiple times it makes sense
to use a set here instead.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1643 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2009-10-05 20:44:54 +00:00
parent 7361b87130
commit c88ec5f91d
3 changed files with 61 additions and 44 deletions

View File

@@ -121,7 +121,7 @@ public:
virtual void OnClientLogin()
{
vector<CSocket*>::const_iterator it;
set<CSocket*>::const_iterator it;
for (it = BeginSockets(); it != EndSockets(); it++) {
CSChatSock *p = (CSChatSock*) *it;
@@ -154,7 +154,7 @@ public:
if (sCom.Equals("chat") && !sArgs.empty()) {
CString sNick = "(s)" + sArgs;
vector<CSocket*>::const_iterator it;
set<CSocket*>::const_iterator it;
for (it = BeginSockets(); it != EndSockets(); it++) {
CSChatSock *pSock = (CSChatSock*) *it;
@@ -193,7 +193,7 @@ public:
Table.AddColumn("Status");
Table.AddColumn("Cipher");
vector<CSocket*>::const_iterator it;
set<CSocket*>::const_iterator it;
for (it = BeginSockets(); it != EndSockets(); it++) {
Table.AddRow();
@@ -230,7 +230,7 @@ public:
if (!sArgs.Equals("(s)", false, 3))
sArgs = "(s)" + sArgs;
vector<CSocket*>::const_iterator it;
set<CSocket*>::const_iterator it;
for (it = BeginSockets(); it != EndSockets(); it++) {
CSChatSock *pSock = (CSChatSock*) *it;
@@ -249,7 +249,7 @@ public:
Table.AddColumn("Type");
Table.AddColumn("Cipher");
vector<CSocket*>::const_iterator it;
set<CSocket*>::const_iterator it;
for (it = BeginSockets(); it != EndSockets(); it++) {
Table.AddRow();
Csock *pSock = *it;