mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 15:19:42 +00:00
LibWeb/IDB: Implement retrieve_a_value_from_an_object_store
This commit is contained in:
parent
d5cf2cee41
commit
18a008d073
Notes:
github-actions[bot]
2025-04-29 15:07:46 +00:00
Author: https://github.com/stelar7
Commit: 18a008d073
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4505
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/gmta ✅
4 changed files with 26 additions and 0 deletions
|
@ -77,4 +77,11 @@ u64 ObjectStore::count_records_in_range(GC::Ref<IDBKeyRange> range)
|
|||
return count;
|
||||
}
|
||||
|
||||
Optional<Record&> ObjectStore::first_in_range(GC::Ref<IDBKeyRange> range)
|
||||
{
|
||||
return m_records.first_matching([&](auto const& record) {
|
||||
return range->is_in_range(record.key);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue