Improve use of NeverDestroyed
[WebKit-https.git] / Source / WebCore / svg / SVGLinearGradientElement.cpp
index 948c6c3..b7ff5b4 100644 (file)
@@ -68,13 +68,9 @@ Ref<SVGLinearGradientElement> SVGLinearGradientElement::create(const QualifiedNa
 
 bool SVGLinearGradientElement::isSupportedAttribute(const QualifiedName& attrName)
 {
-    static NeverDestroyed<HashSet<QualifiedName>> supportedAttributes;
-    if (supportedAttributes.get().isEmpty()) {
-        supportedAttributes.get().add(SVGNames::x1Attr);
-        supportedAttributes.get().add(SVGNames::x2Attr);
-        supportedAttributes.get().add(SVGNames::y1Attr);
-        supportedAttributes.get().add(SVGNames::y2Attr);
-    }
+    static const auto supportedAttributes = makeNeverDestroyed(HashSet<QualifiedName> {
+        SVGNames::x1Attr, SVGNames::x2Attr, SVGNames::y1Attr, SVGNames::y2Attr
+    });
     return supportedAttributes.get().contains<SVGAttributeHashTranslator>(attrName);
 }