From: Maksym Mamontov Date: Mon, 27 Jan 2020 21:30:18 +0000 (+0200) Subject: Remove some more std::list. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/0aa5d347a234d6a636ae481564ac537c8f32a917?ds=sidebyside Remove some more std::list. --- diff --git a/stargazer/admins_impl.cpp b/stargazer/admins_impl.cpp index 8f2760ce..9708f986 100644 --- a/stargazer/admins_impl.cpp +++ b/stargazer/admins_impl.cpp @@ -123,7 +123,7 @@ while (si != searchDescriptors.end()) ++si; } -data.remove(*ai); +data.erase(ai); if (store->DelAdmin(login) < 0) { strError = "Administrator \'" + login + "\' was not deleted. Error: " + store->GetStrError(); diff --git a/stargazer/admins_impl.h b/stargazer/admins_impl.h index 03aa4ece..d54a48c5 100644 --- a/stargazer/admins_impl.h +++ b/stargazer/admins_impl.h @@ -40,7 +40,7 @@ #include "stg/noncopyable.h" #include "stg/logger.h" -#include +#include #include #include @@ -73,14 +73,14 @@ private: ADMINS_IMPL(const ADMINS_IMPL & rvalue); ADMINS_IMPL & operator=(const ADMINS_IMPL & rvalue); - typedef std::list::iterator admin_iter; - typedef std::list::const_iterator const_admin_iter; + typedef std::vector::iterator admin_iter; + typedef std::vector::const_iterator const_admin_iter; int Read(); ADMIN_IMPL stg; ADMIN_IMPL noAdmin; - std::list data; + std::vector data; STORE * store; STG_LOGGER & WriteServLog; mutable std::map searchDescriptors; diff --git a/stargazer/corps_impl.cpp b/stargazer/corps_impl.cpp index 098acaca..3fe3f572 100644 --- a/stargazer/corps_impl.cpp +++ b/stargazer/corps_impl.cpp @@ -111,7 +111,7 @@ while (csi != searchDescriptors.end()) ++csi; } -data.remove(*si); +data.erase(si); if (store->DelCorp(name) < 0) { strError = "Corporation \'" + name + "\' was not deleted. Error: " + store->GetStrError(); diff --git a/stargazer/corps_impl.h b/stargazer/corps_impl.h index 3765c5c1..aa1b3327 100644 --- a/stargazer/corps_impl.h +++ b/stargazer/corps_impl.h @@ -28,7 +28,7 @@ #include "stg/noncopyable.h" #include "stg/logger.h" -#include +#include #include #include @@ -58,12 +58,12 @@ private: CORPORATIONS_IMPL(const CORPORATIONS_IMPL & rvalue); CORPORATIONS_IMPL & operator=(const CORPORATIONS_IMPL & rvalue); - typedef std::list::iterator crp_iter; - typedef std::list::const_iterator const_crp_iter; + typedef std::vector::iterator crp_iter; + typedef std::vector::const_iterator const_crp_iter; bool Read(); - std::list data; + std::vector data; STORE * store; STG_LOGGER & WriteServLog; mutable std::map searchDescriptors; diff --git a/stargazer/services_impl.cpp b/stargazer/services_impl.cpp index 109a327b..216fc645 100644 --- a/stargazer/services_impl.cpp +++ b/stargazer/services_impl.cpp @@ -110,7 +110,7 @@ while (csi != searchDescriptors.end()) ++csi; } -data.remove(*si); +data.erase(si); if (store->DelService(name) < 0) { strError = "Service \'" + name + "\' was not deleted. Error: " + store->GetStrError(); diff --git a/stargazer/services_impl.h b/stargazer/services_impl.h index 8101f2d9..9f0c5c91 100644 --- a/stargazer/services_impl.h +++ b/stargazer/services_impl.h @@ -28,7 +28,7 @@ #include "stg/noncopyable.h" #include "stg/logger.h" -#include +#include #include #include @@ -59,12 +59,12 @@ private: SERVICES_IMPL(const SERVICES_IMPL & rvalue); SERVICES_IMPL & operator=(const SERVICES_IMPL & rvalue); - typedef std::list::iterator iterator; - typedef std::list::const_iterator const_iterator; + typedef std::vector::iterator iterator; + typedef std::vector::const_iterator const_iterator; bool Read(); - std::list data; + std::vector data; STORE * store; STG_LOGGER & WriteServLog; mutable std::map searchDescriptors; diff --git a/stargazer/tariff_impl.h b/stargazer/tariff_impl.h index fe043589..ca55a63a 100644 --- a/stargazer/tariff_impl.h +++ b/stargazer/tariff_impl.h @@ -35,7 +35,6 @@ #include "stg/tariff_conf.h" #include -#include #include #include