From 8c19c2f296ee83ccc444065bc9dfcc2ef98f3624 Mon Sep 17 00:00:00 2001 From: Max Wipfli Date: Mon, 17 May 2021 20:59:15 +0200 Subject: [PATCH] AK: Change some argument and return types in Utf8View from int to size_t This changes the return type of Utf8View::byte_length and the argument types of substring_view from int to size_t. --- AK/Utf8View.cpp | 2 +- AK/Utf8View.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AK/Utf8View.cpp b/AK/Utf8View.cpp index 398eda3e8c4..53276017c91 100644 --- a/AK/Utf8View.cpp +++ b/AK/Utf8View.cpp @@ -53,7 +53,7 @@ size_t Utf8View::byte_offset_of(const Utf8CodepointIterator& it) const return it.m_ptr - begin_ptr(); } -Utf8View Utf8View::substring_view(int byte_offset, int byte_length) const +Utf8View Utf8View::substring_view(size_t byte_offset, size_t byte_length) const { StringView string = m_string.substring_view(byte_offset, byte_length); return Utf8View { string }; diff --git a/AK/Utf8View.h b/AK/Utf8View.h index 966ef252b7b..8fff7990e6f 100644 --- a/AK/Utf8View.h +++ b/AK/Utf8View.h @@ -55,9 +55,9 @@ public: Utf8CodepointIterator end() const; const unsigned char* bytes() const { return begin_ptr(); } - int byte_length() const { return m_string.length(); } + size_t byte_length() const { return m_string.length(); } size_t byte_offset_of(const Utf8CodepointIterator&) const; - Utf8View substring_view(int byte_offset, int byte_length) const; + Utf8View substring_view(size_t byte_offset, size_t byte_length) const; bool is_empty() const { return m_string.is_empty(); } bool starts_with(const Utf8View&) const;