Explorar o código

LibWeb: Use Vector::in_reverse() in DOM::EventDispatcher

Andreas Kling %!s(int64=3) %!d(string=hai) anos
pai
achega
32bff52c25
Modificáronse 1 ficheiros con 1 adicións e 3 borrados
  1. 1 3
      Userland/Libraries/LibWeb/DOM/EventDispatcher.cpp

+ 1 - 3
Userland/Libraries/LibWeb/DOM/EventDispatcher.cpp

@@ -286,9 +286,7 @@ bool EventDispatcher::dispatch(NonnullRefPtr<EventTarget> target, NonnullRefPtr<
         if (activation_target)
         if (activation_target)
             activation_target->legacy_pre_activation_behavior();
             activation_target->legacy_pre_activation_behavior();
 
 
-        for (ssize_t i = event->path().size() - 1; i >= 0; --i) {
-            auto& entry = event->path().at(i);
-
+        for (auto& entry : event->path().in_reverse()) {
             if (entry.shadow_adjusted_target)
             if (entry.shadow_adjusted_target)
                 event->set_phase(Event::Phase::AtTarget);
                 event->set_phase(Event::Phase::AtTarget);
             else
             else