LibWeb/IDB: Implement retrieve_a_value_from_an_object_store

This commit is contained in:
stelar7 2025-04-28 15:55:46 +02:00 committed by Jelle Raaijmakers
commit 18a008d073
Notes: github-actions[bot] 2025-04-29 15:07:46 +00:00
4 changed files with 26 additions and 0 deletions

View file

@ -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);
});
}
}