mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb/IDB: Implement count_the_records_in_a_range
This commit is contained in:
parent
64d251b36c
commit
694375d3ac
Notes:
github-actions[bot]
2025-04-29 15:07:58 +00:00
Author: https://github.com/stelar7
Commit: 694375d3ac
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 22 additions and 0 deletions
|
@ -67,4 +67,14 @@ void ObjectStore::store_a_record(Record const& record)
|
|||
});
|
||||
}
|
||||
|
||||
u64 ObjectStore::count_records_in_range(GC::Ref<IDBKeyRange> range)
|
||||
{
|
||||
u64 count = 0;
|
||||
for (auto const& record : m_records) {
|
||||
if (range->is_in_range(record.key))
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue