diff --git a/lib/EAPBase/include/Config.h b/lib/EAPBase/include/Config.h index 8e44fbd..7d79172 100644 --- a/lib/EAPBase/include/Config.h +++ b/lib/EAPBase/include/Config.h @@ -89,7 +89,6 @@ inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::config &val); #include // Must include after #include -#include #include #include @@ -451,7 +450,7 @@ namespace eap winstd::tstring m_lbl_alt_credential; ///< Alternative label for credential prompt winstd::tstring m_lbl_alt_identity; ///< Alternative label for identity prompt winstd::tstring m_lbl_alt_password; ///< Alternative label for password prompt - std::list > m_methods; ///< List of method configurations + std::vector > m_methods; ///< Array of method configurations }; @@ -551,7 +550,7 @@ namespace eap /// @} public: - std::list m_providers; ///< List of provider configurations + std::vector m_providers; ///< Array of provider configurations }; } diff --git a/lib/EAPBase/src/Config.cpp b/lib/EAPBase/src/Config.cpp index 6a0acf3..fe6a27a 100644 --- a/lib/EAPBase/src/Config.cpp +++ b/lib/EAPBase/src/Config.cpp @@ -296,7 +296,8 @@ eap::config_provider::config_provider(_In_ const config_provider &other) : m_lbl_alt_password(other.m_lbl_alt_password), config(other) { - for (list >::const_iterator method = other.m_methods.cbegin(), method_end = other.m_methods.cend(); method != method_end; ++method) + m_methods.reserve(other.m_methods.size()); + for (vector >::const_iterator method = other.m_methods.cbegin(), method_end = other.m_methods.cend(); method != method_end; ++method) m_methods.push_back(std::move(unique_ptr(*method ? (config_method*)method->get()->clone() : nullptr))); } @@ -332,7 +333,8 @@ eap::config_provider& eap::config_provider::operator=(_In_ const config_provider m_lbl_alt_password = other.m_lbl_alt_password; m_methods.clear(); - for (list >::const_iterator method = other.m_methods.cbegin(), method_end = other.m_methods.cend(); method != method_end; ++method) + m_methods.reserve(other.m_methods.size()); + for (vector >::const_iterator method = other.m_methods.cbegin(), method_end = other.m_methods.cend(); method != method_end; ++method) m_methods.push_back(std::move(unique_ptr(*method ? (config_method*)method->get()->clone() : nullptr))); } @@ -432,7 +434,7 @@ void eap::config_provider::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pC if (FAILED(hr = eapxml::create_element(pDoc, pConfigRoot, bstr(L"eap-metadata:AuthenticationMethods"), bstr(L"AuthenticationMethods"), bstrNamespace, &pXmlElAuthenticationMethods))) throw com_runtime_error(hr, __FUNCTION__ " Error creating element."); - for (list >::const_iterator method = m_methods.cbegin(), method_end = m_methods.cend(); method != method_end; ++method) { + for (vector >::const_iterator method = m_methods.cbegin(), method_end = m_methods.cend(); method != method_end; ++method) { // com_obj pXmlElAuthenticationMethod; if (FAILED(hr = eapxml::create_element(pDoc, bstr(L"AuthenticationMethod"), bstrNamespace, &pXmlElAuthenticationMethod))) @@ -669,7 +671,7 @@ void eap::config_provider_list::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNod if (FAILED(hr = eapxml::select_node(pConfigRoot, bstr(L"eap-metadata:EAPIdentityProviderList"), &pXmlElIdentityProviderList))) throw com_runtime_error(hr, __FUNCTION__ " Error selecting element."); - for (list::const_iterator provider = m_providers.cbegin(), provider_end = m_providers.cend(); provider != provider_end; ++provider) { + for (vector::const_iterator provider = m_providers.cbegin(), provider_end = m_providers.cend(); provider != provider_end; ++provider) { // com_obj pXmlElIdentityProvider; if (FAILED(hr = eapxml::create_element(pDoc, bstr(L"EAPIdentityProvider"), bstrNamespace, &pXmlElIdentityProvider))) diff --git a/lib/EAPBase_UI/include/EAP_UI.h b/lib/EAPBase_UI/include/EAP_UI.h index c12ca0f..e542501 100644 --- a/lib/EAPBase_UI/include/EAP_UI.h +++ b/lib/EAPBase_UI/include/EAP_UI.h @@ -128,10 +128,10 @@ public: // Set extra style here, as wxFormBuilder overrides all default flags. this->SetExtraStyle(this->GetExtraStyle() | wxWS_EX_VALIDATE_RECURSIVELY); - for (std::list::iterator provider = m_cfg.m_providers.begin(), provider_end = m_cfg.m_providers.end(); provider != provider_end; ++provider) { + for (std::vector::iterator provider = m_cfg.m_providers.begin(), provider_end = m_cfg.m_providers.end(); provider != provider_end; ++provider) { bool is_single = provider->m_methods.size() == 1; - std::list >::size_type count = 0; - std::list >::iterator method = provider->m_methods.begin(), method_end = provider->m_methods.end(); + std::vector >::size_type count = 0; + std::vector >::iterator method = provider->m_methods.begin(), method_end = provider->m_methods.end(); for (; method != method_end; ++method, count++) m_providers->AddPage( new _wxT(