[util] Drop unused template arg in string/url, fix msvc warning.
@@ -44,7 +44,7 @@ namespace {
return 0;
}
- template <typename TChar, typename TTraits, typename TBounds>
+ template <typename TChar, typename TBounds>
inline size_t GetHttpPrefixSizeImpl(const TChar* url, const TBounds& urlSize, bool ignorehttps) {
const TChar httpPrefix[] = {'h', 't', 't', 'p', ':', '/', '/', 0};
const TChar httpsPrefix[] = {'h', 't', 't', 'p', 's', ':', '/', '/', 0};
@@ -57,9 +57,7 @@ namespace {
template <typename T>
inline T CutHttpPrefixImpl(const T& url, bool ignorehttps) {
- using TChar = typename T::char_type;
- using TTraits = typename T::traits_type;
- size_t prefixSize = GetHttpPrefixSizeImpl<TChar, TTraits>(url.data(), TKnownSize(url.size()), ignorehttps);
+ size_t prefixSize = GetHttpPrefixSizeImpl<typename T::char_type>(url.data(), TKnownSize(url.size()), ignorehttps);
if (prefixSize)
return url.substr(prefixSize);
return url;
@@ -67,19 +65,19 @@ namespace {
}
size_t GetHttpPrefixSize(const char* url, bool ignorehttps) noexcept {
- return GetHttpPrefixSizeImpl<char, TCharTraits<char>>(url, TUncheckedSize(), ignorehttps);
+ return GetHttpPrefixSizeImpl<char>(url, TUncheckedSize(), ignorehttps);
}
size_t GetHttpPrefixSize(const wchar16* url, bool ignorehttps) noexcept {
- return GetHttpPrefixSizeImpl<wchar16, TCharTraits<wchar16>>(url, TUncheckedSize(), ignorehttps);
+ return GetHttpPrefixSizeImpl<wchar16>(url, TUncheckedSize(), ignorehttps);
}
size_t GetHttpPrefixSize(const TStringBuf url, bool ignorehttps) noexcept {
- return GetHttpPrefixSizeImpl<char, TCharTraits<char>>(url.data(), TKnownSize(url.size()), ignorehttps);
+ return GetHttpPrefixSizeImpl<char>(url.data(), TKnownSize(url.size()), ignorehttps);
}
size_t GetHttpPrefixSize(const TWtringBuf url, bool ignorehttps) noexcept {
- return GetHttpPrefixSizeImpl<wchar16, TCharTraits<wchar16>>(url.data(), TKnownSize(url.size()), ignorehttps);
+ return GetHttpPrefixSizeImpl<wchar16>(url.data(), TKnownSize(url.size()), ignorehttps);
}
TStringBuf CutHttpPrefix(const TStringBuf url, bool ignorehttps) noexcept {
