Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(711)

Unified Diff: third_party/WebKit/Source/core/svg/SVGLength.cpp

Issue 2142513003: Use initializer_lists for static WTF::HashSets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/svg/SVGLength.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGLength.cpp b/third_party/WebKit/Source/core/svg/SVGLength.cpp
index c5fe9da82225eadcf9229ea49e446e1f58833d29..f8000e9b5898794b03601bedafc3de819a27ab2d 100644
--- a/third_party/WebKit/Source/core/svg/SVGLength.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGLength.cpp
@@ -212,21 +212,18 @@ SVGLengthMode SVGLength::lengthModeForAnimatedLengthAttribute(const QualifiedNam
bool SVGLength::negativeValuesForbiddenForAnimatedLengthAttribute(const QualifiedName& attrName)
{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, s_noNegativeValuesSet, ());
-
- if (s_noNegativeValuesSet.isEmpty()) {
- s_noNegativeValuesSet.add(SVGNames::frAttr);
- s_noNegativeValuesSet.add(SVGNames::rAttr);
- s_noNegativeValuesSet.add(SVGNames::rxAttr);
- s_noNegativeValuesSet.add(SVGNames::ryAttr);
- s_noNegativeValuesSet.add(SVGNames::widthAttr);
- s_noNegativeValuesSet.add(SVGNames::heightAttr);
- s_noNegativeValuesSet.add(SVGNames::markerWidthAttr);
- s_noNegativeValuesSet.add(SVGNames::markerHeightAttr);
- s_noNegativeValuesSet.add(SVGNames::textLengthAttr);
- }
-
- return s_noNegativeValuesSet.contains(attrName);
+ DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, noNegativeValuesSet, ({
+ SVGNames::frAttr,
+ SVGNames::rAttr,
+ SVGNames::rxAttr,
+ SVGNames::ryAttr,
+ SVGNames::widthAttr,
+ SVGNames::heightAttr,
+ SVGNames::markerWidthAttr,
+ SVGNames::markerHeightAttr,
+ SVGNames::textLengthAttr,
+ }));
+ return noNegativeValuesSet.contains(attrName);
}
void SVGLength::add(SVGPropertyBase* other, SVGElement* contextElement)
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGUseElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698