From 12b88fa193a36e0d4ed35b1912e5cf1dfe633ce6 Mon Sep 17 00:00:00 2001 From: Maksym Mamontov Date: Mon, 27 Jan 2020 23:23:57 +0200 Subject: [PATCH] Remove std::list from actions. --- stargazer/actions.h | 6 +++--- stargazer/actions.inl.h | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/stargazer/actions.h b/stargazer/actions.h index 66b8556d..eea72b77 100644 --- a/stargazer/actions.h +++ b/stargazer/actions.h @@ -14,7 +14,7 @@ // actionsList.InvokeAll(); #include -#include +#include #include // Generalized actor type - a method of some class with one argument @@ -54,11 +54,11 @@ private: // A list of an actions // All methods are thread-safe -class ACTIONS_LIST : private std::list +class ACTIONS_LIST : private std::vector { public: // Just a typedef for parent class - typedef std::list parent; + typedef std::vector parent; // Initialize mutex ACTIONS_LIST(); diff --git a/stargazer/actions.inl.h b/stargazer/actions.inl.h index b5b3f8a5..392626ab 100644 --- a/stargazer/actions.inl.h +++ b/stargazer/actions.inl.h @@ -29,7 +29,7 @@ ACTIONS_LIST::~ACTIONS_LIST() STG_LOCKER lock(&mutex); parent::iterator it(parent::begin()); - while (it != parent::end()) + while (it != parent::end()) { delete *it++; } @@ -40,28 +40,28 @@ pthread_mutex_destroy(&mutex); inline ACTIONS_LIST::parent::iterator ACTIONS_LIST::begin() -{ +{ STG_LOCKER lock(&mutex); return parent::begin(); } inline ACTIONS_LIST::parent::iterator ACTIONS_LIST::end() -{ +{ STG_LOCKER lock(&mutex); return parent::end(); } inline ACTIONS_LIST::parent::const_iterator ACTIONS_LIST::begin() const -{ +{ STG_LOCKER lock(&mutex); return parent::begin(); } inline ACTIONS_LIST::parent::const_iterator ACTIONS_LIST::end() const -{ +{ STG_LOCKER lock(&mutex); return parent::end(); } -- 2.43.2