From 2591231bbebbcded704af0bb7b9dd6ed60c399bd Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 20 Mar 2023 21:24:51 +0100 Subject: [PATCH] Fixed more cases of using String.size() instead of String.length(). --- modules/web/html/html_builder.cpp | 2 +- modules/web/html/html_builder_bind.cpp | 2 +- modules/web/html/paginator.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/web/html/html_builder.cpp b/modules/web/html/html_builder.cpp index f091f6bfd..e71f7f1d7 100644 --- a/modules/web/html/html_builder.cpp +++ b/modules/web/html/html_builder.cpp @@ -863,7 +863,7 @@ HTMLBuilder *HTMLTag::f() { } bool HTMLTag::has_data() { - return result.size() > 0; + return result.length() > 0; } HTMLTag::HTMLTag() { diff --git a/modules/web/html/html_builder_bind.cpp b/modules/web/html/html_builder_bind.cpp index 28776f488..9e2e96339 100644 --- a/modules/web/html/html_builder_bind.cpp +++ b/modules/web/html/html_builder_bind.cpp @@ -887,7 +887,7 @@ Ref<_HTMLBuilder> _HTMLTag::f() { } bool _HTMLTag::has_data() { - return result.size() > 0; + return result.length() > 0; } _HTMLTag::_HTMLTag() { diff --git a/modules/web/html/paginator.cpp b/modules/web/html/paginator.cpp index c45ba5820..bbdd00362 100644 --- a/modules/web/html/paginator.cpp +++ b/modules/web/html/paginator.cpp @@ -131,7 +131,7 @@ String HTMLPaginator::_render_indexed(Ref target, const int page_ } String s = target->base_url; - if (s.size() > 0 && s[s.size() - 1] != '/') { + if (s.length() > 0 && s[s.length() - 1] != '/') { s += '/'; } @@ -221,7 +221,7 @@ String HTMLPaginator::_render_links(Ref target, const int page_in } String s = target->base_url; - if (s.size() > 0 && s[s.size() - 1] != '/') { + if (s.length() > 0 && s[s.length() - 1] != '/') { s += '/'; } @@ -301,7 +301,7 @@ String HTMLPaginator::_render_links(Ref target, const int page_in String HTMLPaginator::get_pagination_old(const String &base_url, const int max, const int current_index, const int max_visible_links) { String s = base_url; - if (s.size() > 0 && s[s.size() - 1] != '/') { + if (s.length() > 0 && s[s.length() - 1] != '/') { s += '/'; } @@ -379,7 +379,7 @@ String HTMLPaginator::get_pagination_old(const String &base_url, const int max, String HTMLPaginator::get_pagination_links_old(const String &base_url, const Vector &links, const int current_index, const int max_visible_links) { String s = base_url; - if (s.size() > 0 && s[s.size() - 1] != '/') { + if (s.length() > 0 && s[s.length() - 1] != '/') { s += '/'; }