diff --git a/Userland/Libraries/LibSQL/BTree.cpp b/Userland/Libraries/LibSQL/BTree.cpp index 928b8192ec..092262d9aa 100644 --- a/Userland/Libraries/LibSQL/BTree.cpp +++ b/Userland/Libraries/LibSQL/BTree.cpp @@ -65,7 +65,6 @@ bool BTree::insert(Key const& key) { if (!m_root) initialize_root(); - VERIFY(m_root); return m_root->insert(key); } @@ -73,7 +72,6 @@ bool BTree::update_key_pointer(Key const& key) { if (!m_root) initialize_root(); - VERIFY(m_root); return m_root->update_key_pointer(key); } @@ -81,7 +79,6 @@ Optional BTree::get(Key& key) { if (!m_root) initialize_root(); - VERIFY(m_root); return m_root->get(key); } @@ -89,7 +86,6 @@ BTreeIterator BTree::find(Key const& key) { if (!m_root) initialize_root(); - VERIFY(m_root); for (auto node = m_root->node_for(key); node; node = node->up()) { for (auto ix = 0u; ix < node->size(); ix++) { auto match = (*node)[ix].match(key); diff --git a/Userland/Libraries/LibSQL/HashIndex.cpp b/Userland/Libraries/LibSQL/HashIndex.cpp index f913cec43b..df7f4a56ff 100644 --- a/Userland/Libraries/LibSQL/HashIndex.cpp +++ b/Userland/Libraries/LibSQL/HashIndex.cpp @@ -187,13 +187,11 @@ Key const& HashBucket::operator[](size_t ix) { if (!m_inflated) m_hash_index.serializer().deserialize_block_to(pointer(), *this); - VERIFY(ix < size()); return m_entries[ix]; } Key const& HashBucket::operator[](size_t ix) const { - VERIFY(ix < m_entries.size()); return m_entries[ix]; } diff --git a/Userland/Libraries/LibSQL/Heap.h b/Userland/Libraries/LibSQL/Heap.h index 40be6d5386..19c5b6231e 100644 --- a/Userland/Libraries/LibSQL/Heap.h +++ b/Userland/Libraries/LibSQL/Heap.h @@ -70,13 +70,11 @@ public: u32 user_value(size_t index) const { - VERIFY(index < m_user_values.size()); return m_user_values[index]; } void set_user_value(size_t index, u32 value) { - VERIFY(index < m_user_values.size()); m_user_values[index] = value; update_zero_block(); } diff --git a/Userland/Libraries/LibSQL/Serializer.h b/Userland/Libraries/LibSQL/Serializer.h index 71903ca973..ee250c92ee 100644 --- a/Userland/Libraries/LibSQL/Serializer.h +++ b/Userland/Libraries/LibSQL/Serializer.h @@ -28,7 +28,6 @@ public: void get_block(u32 pointer) { - VERIFY(m_heap.ptr() != nullptr); auto buffer_or_error = m_heap->read_block(pointer); if (buffer_or_error.is_error()) VERIFY_NOT_REACHED(); @@ -110,7 +109,7 @@ public: template bool serialize_and_write(T const& t) { - VERIFY(m_heap.ptr() != nullptr); + VERIFY(!m_heap.is_null()); reset(); serialize(t); m_heap->add_to_wal(t.pointer(), m_buffer); @@ -120,20 +119,17 @@ public: [[nodiscard]] size_t offset() const { return m_current_offset; } u32 new_record_pointer() { - VERIFY(m_heap.ptr() != nullptr); return m_heap->new_record_pointer(); } bool has_block(u32 pointer) const { - VERIFY(m_heap.ptr() != nullptr); return pointer < m_heap->size(); } Heap& heap() { - VERIFY(m_heap.ptr() != nullptr); - return *(m_heap.ptr()); + return *m_heap; } private: diff --git a/Userland/Libraries/LibSQL/Value.h b/Userland/Libraries/LibSQL/Value.h index 380bb487a3..1adff1382f 100644 --- a/Userland/Libraries/LibSQL/Value.h +++ b/Userland/Libraries/LibSQL/Value.h @@ -68,7 +68,6 @@ public: [[nodiscard]] auto const& value() const { - VERIFY(m_value.has_value()); return *m_value; }