From 6cd929eaa3fd2df4eaa3c9e1be747e400426e38a Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Thu, 31 May 2018 20:22:37 +0100 Subject: [PATCH] easylogging++: remove std::deque usage It's not actually needed for this use, and saves a STL header --- external/easylogging++/easylogging++.cc | 8 +++++++- external/easylogging++/easylogging++.h | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/external/easylogging++/easylogging++.cc b/external/easylogging++/easylogging++.cc index a4bdad4cf..1139008e2 100644 --- a/external/easylogging++/easylogging++.cc +++ b/external/easylogging++/easylogging++.cc @@ -1981,6 +1981,12 @@ void VRegistry::setCategories(const char* categories, bool clear) { m_categoriesString += ","; m_categoriesString += categories; + size_t n_fields = m_categories.size() + 1; + for (const char *ptr = categories; *ptr; ++ptr) + if (*ptr == ',') + ++n_fields; + m_categories.reserve(n_fields); + bool isCat = true; bool isLevel = false; std::stringstream ss; @@ -2042,7 +2048,7 @@ bool VRegistry::allowed(Level level, const char* category) { if (m_categories.empty() || category == nullptr) { return false; } else { - std::deque>::const_reverse_iterator it = m_categories.rbegin(); + std::vector>::const_reverse_iterator it = m_categories.rbegin(); for (; it != m_categories.rend(); ++it) { if (base::utils::Str::wildCardMatch(category, it->first.c_str())) { const int p = priority(it->second); diff --git a/external/easylogging++/easylogging++.h b/external/easylogging++/easylogging++.h index 8e8b7094b..8bf94c546 100644 --- a/external/easylogging++/easylogging++.h +++ b/external/easylogging++/easylogging++.h @@ -386,7 +386,6 @@ ELPP_INTERNAL_DEBUGGING_OUT_INFO << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStre #include #include #include -#include #include #include #include @@ -2531,7 +2530,7 @@ class VRegistry : base::NoCopy, public base::threading::ThreadSafe { base::type::VerboseLevel m_level; base::type::EnumType* m_pFlags; std::map m_modules; - std::deque> m_categories; + std::vector> m_categories; std::map m_cached_allowed_categories; std::string m_categoriesString; std::string m_filenameCommonPrefix;