mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-21 23:50:06 +00:00
LibWeb/IDB: Move Records and give more descriptive names
This commit is contained in:
parent
87af53a613
commit
fe5d5639ef
Notes:
github-actions[bot]
2025-08-27 14:15:50 +00:00
Author: https://github.com/stelar7
Commit: fe5d5639ef
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5385
Reviewed-by: https://github.com/gmta ✅
5 changed files with 55 additions and 38 deletions
|
@ -57,7 +57,7 @@ bool ObjectStore::has_record_with_key(GC::Ref<Key> key)
|
|||
return index != m_records.end();
|
||||
}
|
||||
|
||||
void ObjectStore::store_a_record(Record const& record)
|
||||
void ObjectStore::store_a_record(ObjectStoreRecord const& record)
|
||||
{
|
||||
m_records.append(record);
|
||||
|
||||
|
@ -77,7 +77,7 @@ u64 ObjectStore::count_records_in_range(GC::Ref<IDBKeyRange> range)
|
|||
return count;
|
||||
}
|
||||
|
||||
Optional<Record&> ObjectStore::first_in_range(GC::Ref<IDBKeyRange> range)
|
||||
Optional<ObjectStoreRecord&> ObjectStore::first_in_range(GC::Ref<IDBKeyRange> range)
|
||||
{
|
||||
return m_records.first_matching([&](auto const& record) {
|
||||
return range->is_in_range(record.key);
|
||||
|
@ -89,9 +89,9 @@ void ObjectStore::clear_records()
|
|||
m_records.clear();
|
||||
}
|
||||
|
||||
GC::ConservativeVector<Record> ObjectStore::first_n_in_range(GC::Ref<IDBKeyRange> range, Optional<WebIDL::UnsignedLong> count)
|
||||
GC::ConservativeVector<ObjectStoreRecord> ObjectStore::first_n_in_range(GC::Ref<IDBKeyRange> range, Optional<WebIDL::UnsignedLong> count)
|
||||
{
|
||||
GC::ConservativeVector<Record> records(range->heap());
|
||||
GC::ConservativeVector<ObjectStoreRecord> records(range->heap());
|
||||
for (auto const& record : m_records) {
|
||||
if (range->is_in_range(record.key))
|
||||
records.append(record);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue