LibWeb/IDB: Implement IDBIndex::get

This commit is contained in:
stelar7 2025-05-13 22:18:14 +02:00 committed by Jelle Raaijmakers
commit e74e571b56
Notes: github-actions[bot] 2025-05-14 15:19:35 +00:00
7 changed files with 62 additions and 3 deletions

View file

@ -76,4 +76,11 @@ void Index::clear_records()
m_records.clear();
}
Optional<IndexRecord&> Index::first_in_range(GC::Ref<IDBKeyRange> range)
{
return m_records.first_matching([&](auto const& record) {
return range->is_in_range(record.key);
});
}
}