mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:07:34 +00:00
LibSQL: Remove and update VERIFY
s
We are performing a lot of checks on pointers that are performed again immediately afterwards because of a dereference. This removes the redundant `VERIFY`s and simplifies a couple others.
This commit is contained in:
parent
036eb82aca
commit
8992ff5aeb
5 changed files with 2 additions and 15 deletions
|
@ -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<u32> 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue