summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
Diffstat (limited to 'AK')
-rw-r--r--AK/ByteBuffer.h10
-rw-r--r--AK/String.h2
-rw-r--r--AK/Vector.h2
3 files changed, 0 insertions, 14 deletions
diff --git a/AK/ByteBuffer.h b/AK/ByteBuffer.h
index 3b188695b3..f3b299e586 100644
--- a/AK/ByteBuffer.h
+++ b/AK/ByteBuffer.h
@@ -28,7 +28,6 @@ public:
{
grow(other.size());
VERIFY(m_size == other.size());
- VERIFY(!m_is_null);
__builtin_memcpy(data(), other.data(), other.size());
}
@@ -96,10 +95,6 @@ public:
bool operator!=(ByteBuffer const& other) const { return !(*this == other); }
- operator bool() const { return !is_null(); }
- bool operator!() const { return is_null(); }
- [[nodiscard]] bool is_null() const { return m_is_null; }
-
[[nodiscard]] u8& operator[](size_t i)
{
VERIFY(i < m_size);
@@ -152,7 +147,6 @@ public:
void grow(size_t new_size)
{
- m_is_null = false;
if (new_size <= m_size)
return;
if (new_size <= capacity()) {
@@ -208,20 +202,17 @@ private:
ByteBuffer(size_t size)
{
grow(size);
- VERIFY(!m_is_null);
VERIFY(m_size == size);
}
void move_from(ByteBuffer&& other)
{
- m_is_null = other.m_is_null;
m_size = other.m_size;
if (other.m_size > inline_capacity) {
m_outline_buffer = other.m_outline_buffer;
m_outline_capacity = other.m_outline_capacity;
} else
__builtin_memcpy(m_inline_buffer, other.m_inline_buffer, other.m_size);
- other.m_is_null = true;
other.m_size = 0;
}
@@ -242,7 +233,6 @@ private:
size_t capacity() const { return is_inline() ? inline_capacity : m_outline_capacity; }
size_t m_size { 0 };
- bool m_is_null { true };
union {
u8 m_inline_buffer[inline_capacity];
struct {
diff --git a/AK/String.h b/AK/String.h
index 621ff92dc1..ff729558cd 100644
--- a/AK/String.h
+++ b/AK/String.h
@@ -240,8 +240,6 @@ public:
template<typename BufferType>
[[nodiscard]] static String copy(const BufferType& buffer, ShouldChomp should_chomp = NoChomp)
{
- if (buffer.is_null())
- return {};
if (buffer.is_empty())
return empty();
return String((const char*)buffer.data(), buffer.size(), should_chomp);
diff --git a/AK/Vector.h b/AK/Vector.h
index 7acc9bdd15..55cf46ca2a 100644
--- a/AK/Vector.h
+++ b/AK/Vector.h
@@ -150,8 +150,6 @@ public:
return false;
}
- // NOTE: Vector::is_null() exists for the benefit of String::copy().
- bool is_null() const { return false; }
bool is_empty() const { return size() == 0; }
ALWAYS_INLINE size_t size() const { return m_size; }
size_t capacity() const { return m_capacity; }