diff --git a/src/common/string_util.h b/src/common/string_util.h index 5d96eca8..c967f7b7 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h @@ -129,47 +129,13 @@ ALWAYS_INLINE static bool EndsWith(const std::string_view& str, const char* suff return (str.length() >= suffix_length && str.compare(str.length() - suffix_length, suffix_length, suffix) == 0); } -/// Strided memcpy/memcmp. -ALWAYS_INLINE static void StrideMemCpy(void* dst, std::size_t dst_stride, const void* src, std::size_t src_stride, - std::size_t copy_size, std::size_t count) -{ - const u8* src_ptr = static_cast(src); - u8* dst_ptr = static_cast(dst); - for (std::size_t i = 0; i < count; i++) - { - std::memcpy(dst_ptr, src_ptr, copy_size); - src_ptr += src_stride; - dst_ptr += dst_stride; - } -} - -ALWAYS_INLINE static int StrideMemCmp(const void* p1, std::size_t p1_stride, const void* p2, std::size_t p2_stride, - std::size_t copy_size, std::size_t count) -{ - const u8* p1_ptr = static_cast(p1); - const u8* p2_ptr = static_cast(p2); - for (std::size_t i = 0; i < count; i++) - { - int result = std::memcmp(p1_ptr, p2_ptr, copy_size); - if (result != 0) - return result; - p2_ptr += p2_stride; - p1_ptr += p1_stride; - } - - return 0; -} - #ifdef _WIN32 - /// Converts the specified UTF-8 string to a wide string. std::wstring UTF8StringToWideString(const std::string_view& str); bool UTF8StringToWideString(std::wstring& dest, const std::string_view& str); - /// Converts the specified wide string to a UTF-8 string. std::string WideStringToUTF8String(const std::wstring_view& str); bool WideStringToUTF8String(std::string& dest, const std::wstring_view& str); - #endif } // namespace StringUtil