mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 07:41:01 +00:00
LibWeb: Use a HashTable when querying SessionHistoryTraversalQueue
Instead of asking "do you have an entry not in this Vector", let's ask "do you have an entry not in this HashTable".
This commit is contained in:
parent
a1519e67fb
commit
861d46be3e
Notes:
github-actions[bot]
2024-08-06 14:34:06 +00:00
Author: https://github.com/awesomekling
Commit: 861d46be3e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/993
3 changed files with 6 additions and 6 deletions
|
@ -63,10 +63,10 @@ void SessionHistoryTraversalQueue::append_sync(Function<void()> steps, JS::GCPtr
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#sync-navigations-jump-queue
|
||||
JS::GCPtr<SessionHistoryTraversalQueueEntry> SessionHistoryTraversalQueue::first_synchronous_navigation_steps_with_target_navigable_not_contained_in(Vector<JS::GCPtr<Navigable>> const& list)
|
||||
JS::GCPtr<SessionHistoryTraversalQueueEntry> SessionHistoryTraversalQueue::first_synchronous_navigation_steps_with_target_navigable_not_contained_in(HashTable<JS::NonnullGCPtr<Navigable>> const& set)
|
||||
{
|
||||
auto index = m_queue.find_first_index_if([&list](auto const& entry) -> bool {
|
||||
return (entry->target_navigable() != nullptr) && !list.contains_slow(entry->target_navigable());
|
||||
auto index = m_queue.find_first_index_if([&set](auto const& entry) -> bool {
|
||||
return (entry->target_navigable() != nullptr) && !set.contains(*entry->target_navigable());
|
||||
});
|
||||
if (index.has_value())
|
||||
return m_queue.take(*index);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue