1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

LibSQL: Use Block::Index everywhere; rename pointer to block_index

No functional changes.
This commit is contained in:
Jelle Raaijmakers 2023-04-23 13:59:56 +02:00 committed by Tim Flynn
parent 6601ff9d65
commit fdac8331cc
19 changed files with 202 additions and 203 deletions

View file

@ -24,7 +24,7 @@ namespace SQL {
class HashBucket : public IndexNode
, public Weakable<HashBucket> {
public:
HashBucket(HashIndex&, u32 index, u32 local_depth, u32 pointer);
HashBucket(HashIndex&, Block::Index index, u32 local_depth, Block::Index pointer);
~HashBucket() override = default;
Optional<u32> get(Key&);
bool insert(Key const&);
@ -35,7 +35,7 @@ public:
[[nodiscard]] u32 size() { return entries().size(); }
[[nodiscard]] size_t length() const;
[[nodiscard]] u32 size() const { return m_entries.size(); }
[[nodiscard]] u32 index() const { return m_index; }
[[nodiscard]] Block::Index index() const { return m_index; }
void serialize(Serializer&) const;
void deserialize(Serializer&);
[[nodiscard]] HashIndex const& hash_index() const { return m_hash_index; }
@ -45,12 +45,12 @@ public:
private:
Optional<size_t> find_key_in_bucket(Key const&);
void set_index(u32 index) { m_index = index; }
void set_index(Block::Index index) { m_index = index; }
void set_local_depth(u32 depth) { m_local_depth = depth; }
HashIndex& m_hash_index;
u32 m_local_depth { 1 };
u32 m_index { 0 };
Block::Index m_index { 0 };
Vector<Key> m_entries;
bool m_inflated { false };
@ -79,7 +79,7 @@ public:
void list_hash();
private:
HashIndex(Serializer&, NonnullRefPtr<TupleDescriptor> const&, u32);
HashIndex(Serializer&, NonnullRefPtr<TupleDescriptor> const&, Block::Index);
void expand();
void write_directory();