[Web Animations] Audit Web Animations classes for memory reduction
[WebKit-https.git] / Source / WebCore / animation / AnimationPlaybackEvent.cpp
index 8cfa54f..3ad1aed 100644 (file)
@@ -33,15 +33,15 @@ namespace WebCore {
 AnimationPlaybackEvent::AnimationPlaybackEvent(const AtomicString& type, const AnimationPlaybackEventInit& initializer, IsTrusted isTrusted)
     : Event(type, initializer, isTrusted)
 {
-    if (initializer.currentTime == WTF::nullopt)
-        m_currentTime = WTF::nullopt;
+    if (initializer.currentTime)
+        m_currentTime = Seconds::fromMilliseconds(*initializer.currentTime);
     else
-        m_currentTime = Seconds::fromMilliseconds(initializer.currentTime.value());
+        m_currentTime = WTF::nullopt;
 
-    if (initializer.timelineTime == WTF::nullopt)
-        m_timelineTime = WTF::nullopt;
+    if (initializer.timelineTime)
+        m_timelineTime = Seconds::fromMilliseconds(*initializer.timelineTime);
     else
-        m_timelineTime = Seconds::fromMilliseconds(initializer.timelineTime.value());
+        m_timelineTime = WTF::nullopt;
 }
 
 AnimationPlaybackEvent::AnimationPlaybackEvent(const AtomicString& type, Optional<Seconds> currentTime, Optional<Seconds> timelineTime)