diff --git a/CefSharp.Core/Internals/CookieManager.cpp b/CefSharp.Core/Internals/CookieManager.cpp index 2fcd642df..a2bb7a1b4 100644 --- a/CefSharp.Core/Internals/CookieManager.cpp +++ b/CefSharp.Core/Internals/CookieManager.cpp @@ -66,13 +66,7 @@ namespace CefSharp { ThrowIfDisposed(); - vector schemeVector; - for each(String^ scheme in schemes) - { - schemeVector.push_back(StringUtils::ToNative(scheme)); - } - - _cookieManager->SetSupportedSchemes(schemeVector, NULL); + _cookieManager->SetSupportedSchemes(StringUtils::ToNative(schemes), NULL); } bool CookieManager::VisitAllCookies(ICookieVisitor^ visitor) diff --git a/CefSharp.Core/Internals/StringUtils.cpp b/CefSharp.Core/Internals/StringUtils.cpp index 4c74bdc7b..b56f0520f 100644 --- a/CefSharp.Core/Internals/StringUtils.cpp +++ b/CefSharp.Core/Internals/StringUtils.cpp @@ -50,7 +50,7 @@ namespace CefSharp } [DebuggerStepThrough] - std::vector StringUtils::ToNative(List^ str) + std::vector StringUtils::ToNative(IEnumerable^ str) { if (str == nullptr) { diff --git a/CefSharp.Core/Internals/StringUtils.h b/CefSharp.Core/Internals/StringUtils.h index 7d39546ca..a2d3ba83e 100644 --- a/CefSharp.Core/Internals/StringUtils.h +++ b/CefSharp.Core/Internals/StringUtils.h @@ -50,7 +50,7 @@ namespace CefSharp /// /// The List of strings that should be converted. /// An unmanaged representation of the provided List of strings, or an empty List if the input is a nullptr. - static std::vector ToNative(List^ str); + static std::vector ToNative(IEnumerable^ str); /// /// Assigns the provided cef_string_t object from the given .NET string.