LibWeb: Add const qualifiers to Vector iteration in IndexedDB

This commit is contained in:
stelar7 2024-12-01 21:11:57 +01:00 committed by Jelle Raaijmakers
commit 452506964c
Notes: github-actions[bot] 2024-12-14 22:04:36 +00:00

View file

@ -81,7 +81,7 @@ WebIDL::ExceptionOr<GC::Ref<IDBDatabase>> open_a_database_connection(JS::Realm&
// queue a task to fire a version change event named versionchange at entry with dbs version and version.
IGNORE_USE_IN_ESCAPING_LAMBDA u32 events_to_fire = open_connections.size();
IGNORE_USE_IN_ESCAPING_LAMBDA u32 events_fired = 0;
for (auto& entry : open_connections) {
for (auto const& entry : open_connections) {
if (!entry->close_pending()) {
HTML::queue_a_task(HTML::Task::Source::DatabaseAccess, nullptr, nullptr, GC::create_function(realm.vm().heap(), [&realm, entry, db, version, &events_fired]() {
fire_a_version_change_event(realm, HTML::EventNames::versionchange, *entry, db->version(), version);
@ -99,7 +99,7 @@ WebIDL::ExceptionOr<GC::Ref<IDBDatabase>> open_a_database_connection(JS::Realm&
// 4. If any of the connections in openConnections are still not closed,
// queue a task to fire a version change event named blocked at request with dbs version and version.
for (auto& entry : open_connections) {
for (auto const& entry : open_connections) {
if (entry->state() != IDBDatabase::ConnectionState::Closed) {
HTML::queue_a_task(HTML::Task::Source::DatabaseAccess, nullptr, nullptr, GC::create_function(realm.vm().heap(), [&realm, entry, db, version]() {
fire_a_version_change_event(realm, HTML::EventNames::blocked, *entry, db->version(), version);