mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb/IDB: Implement retrieve_multiple_values_from_an_object_store
This commit is contained in:
parent
7f98d708ef
commit
ddaae635ac
Notes:
github-actions[bot]
2025-05-12 20:29:36 +00:00
Author: https://github.com/stelar7
Commit: ddaae635ac
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4662
Reviewed-by: https://github.com/shannonbooth ✅
4 changed files with 49 additions and 0 deletions
|
@ -89,4 +89,18 @@ 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<Record> records(range->heap());
|
||||
for (auto const& record : m_records) {
|
||||
if (range->is_in_range(record.key))
|
||||
records.append(record);
|
||||
|
||||
if (count.has_value() && records.size() >= *count)
|
||||
break;
|
||||
}
|
||||
|
||||
return records;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue