From 53d015082749b9bf43a2160d5553bc0e9e1086ef Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sun, 16 May 2021 08:47:46 +0200 Subject: AK+Userland: Remove nullability feature for the ByteBuffer type Nobody seems to use this particular feature, in fact there were some bugs which were uncovered by removing operator bool. --- Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp | 2 +- Userland/Libraries/LibWeb/Loader/Resource.h | 2 +- Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Userland/Libraries/LibWeb') diff --git a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp index 83366ae1f7..244ba6c0cc 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp @@ -431,7 +431,7 @@ public: if (type != CSS::Selector::SimpleSelector::Type::Universal) { while (is_valid_selector_char(peek())) buffer.append(consume_one()); - PARSE_VERIFY(!buffer.is_null()); + PARSE_VERIFY(!buffer.is_empty()); } auto value = String::copy(buffer); diff --git a/Userland/Libraries/LibWeb/Loader/Resource.h b/Userland/Libraries/LibWeb/Loader/Resource.h index 1575040ba0..1fca238e3e 100644 --- a/Userland/Libraries/LibWeb/Loader/Resource.h +++ b/Userland/Libraries/LibWeb/Loader/Resource.h @@ -42,7 +42,7 @@ public: bool is_failed() const { return m_failed; } const String& error() const { return m_error; } - bool has_encoded_data() const { return !m_encoded_data.is_null(); } + bool has_encoded_data() const { return !m_encoded_data.is_empty(); } const URL& url() const { return m_request.url(); } const ByteBuffer& encoded_data() const { return m_encoded_data; } diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp index baa68b4727..250f22fc39 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp @@ -47,7 +47,7 @@ void XMLHttpRequest::fire_progress_event(const String& event_name, u64 transmitt String XMLHttpRequest::response_text() const { - if (m_response_object.is_null()) + if (m_response_object.is_empty()) return {}; return String::copy(m_response_object); } -- cgit v1.2.3