Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zeex/f05515ba113db97176fd to your computer and use it in GitHub Desktop.
Save Zeex/f05515ba113db97176fd to your computer and use it in GitHub Desktop.
diff --git a/src/CCallback.cpp b/src/CCallback.cpp
index a358b40..6ef5a12 100644
--- a/src/CCallback.cpp
+++ b/src/CCallback.cpp
@@ -13,7 +13,7 @@
CCallback *CCallback::m_Instance = new CCallback;
-void CCallback::ProcessCallbacks()
+void CCallback::ProcessCallbacks()
{
CMySQLQuery *query = NULL;
while(m_CallbackQueue.pop(query))
@@ -35,7 +35,7 @@ void CCallback::ProcessCallbacks()
if (!query->Callback.Name.empty())
{
const bool pass_by_ref = (query->Callback.Name.find("FJ37DH3JG") != string::npos);
- for (set<AMX *>::iterator a = m_AmxList.begin(), end = m_AmxList.end(); a != end; ++a)
+ for (list<AMX *>::iterator a = m_AmxList.begin(), end = m_AmxList.end(); a != end; ++a)
{
AMX *amx = (*a);
int amx_index;
diff --git a/src/CCallback.h b/src/CCallback.h
index 0aadf5b..95659bd 100644
--- a/src/CCallback.h
+++ b/src/CCallback.h
@@ -6,12 +6,12 @@
#include <stack>
#include <string>
#include <boost/variant.hpp>
-#include <set>
+#include <list>
#include <boost/lockfree/queue.hpp>
using std::stack;
using std::string;
-using std::set;
+using std::list;
#include "main.h"
@@ -20,7 +20,7 @@ class CMySQLHandle;
class CMySQLQuery;
-class CCallback
+class CCallback
{
private:
static CCallback *m_Instance;
@@ -32,7 +32,7 @@ private:
boost::lockfree::capacity<32648>
> m_CallbackQueue;
- set<AMX *> m_AmxList;
+ list<AMX *> m_AmxList;
CCallback() { }
~CCallback() { }
@@ -59,11 +59,11 @@ public:
inline void AddAmx(AMX *amx)
{
- m_AmxList.insert(amx);
+ m_AmxList.push_back(amx);
}
inline void EraseAmx(AMX *amx)
{
- m_AmxList.erase(amx);
+ m_AmxList.remove(amx);
}
void ClearByHandle(CMySQLHandle *handle);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment