1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:47:44 +00:00

LibSQL: Make TupleDescriptor a shared pointer instead of a stack object

Tuple descriptors are basically the same for for example all rows in
a table. Makes sense to share them instead of copying them for every
single row.
This commit is contained in:
Jan de Visser 2021-07-13 13:47:08 -04:00 committed by Andreas Kling
parent 9e225d2d05
commit a5e28f2897
17 changed files with 95 additions and 94 deletions

View file

@ -123,9 +123,9 @@ void insert_into_and_scan_hash_index(int num_keys);
NonnullRefPtr<SQL::HashIndex> setup_hash_index(SQL::Heap& heap)
{
SQL::TupleDescriptor tuple_descriptor;
tuple_descriptor.append({ "key_value", SQL::SQLType::Integer, SQL::Order::Ascending });
tuple_descriptor.append({ "text_value", SQL::SQLType::Text, SQL::Order::Ascending });
NonnullRefPtr<SQL::TupleDescriptor> tuple_descriptor = adopt_ref(*new SQL::TupleDescriptor);
tuple_descriptor->append({ "key_value", SQL::SQLType::Integer, SQL::Order::Ascending });
tuple_descriptor->append({ "text_value", SQL::SQLType::Text, SQL::Order::Ascending });
auto directory_pointer = heap.user_value(0);
if (!directory_pointer) {