Skip to content

Commit

Permalink
LibWeb: Add const qualifiers to Vector iteration in IndexedDB
Browse files Browse the repository at this point in the history
  • Loading branch information
stelar7 authored and gmta committed Dec 14, 2024
1 parent 0327541 commit 4525069
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Libraries/LibWeb/IndexedDB/Internal/Algorithms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 db’s 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);
Expand All @@ -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 db’s 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);
Expand Down

0 comments on commit 4525069

Please sign in to comment.