Improve use of NeverDestroyed
[WebKit-https.git] / Source / WebCore / platform / cocoa / WebVideoFullscreenModelVideoElement.mm
index ca4fbe0..9b8078c 100644 (file)
@@ -173,11 +173,8 @@ void WebVideoFullscreenModelVideoElement::setVideoLayerGravity(WebVideoFullscree
 
 const Vector<AtomicString>& WebVideoFullscreenModelVideoElement::observedEventNames()
 {
-    static NeverDestroyed<Vector<AtomicString>> sEventNames;
-
-    if (!sEventNames.get().size())
-        sEventNames.get().append(eventNames().resizeEvent);
-    return sEventNames.get();
+    static const auto names = makeNeverDestroyed(Vector<AtomicString> { eventNames().resizeEvent });
+    return names;
 }
 
 const AtomicString& WebVideoFullscreenModelVideoElement::eventNameAll()