mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02: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:
committed by
Andreas Kling
parent
9e225d2d05
commit
a5e28f2897
Notes:
sideshowbarker
2024-07-18 05:26:25 +09:00
Author: https://github.com/JanDeVisser Commit: https://github.com/SerenityOS/serenity/commit/a5e28f2897c Pull-request: https://github.com/SerenityOS/serenity/pull/8906 Reviewed-by: https://github.com/trflynn89 ✅
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user