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

Unified Diff: third_party/WebKit/Source/core/xml/XPathParser.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/xml/XPathParser.cpp
diff --git a/third_party/WebKit/Source/core/xml/XPathParser.cpp b/third_party/WebKit/Source/core/xml/XPathParser.cpp
index 3d2a055ceecc3d7a9891b9c55a423e1778e72440..c44cbba1446db6b1794bd4da0dffe3f82bab7e28 100644
--- a/third_party/WebKit/Source/core/xml/XPathParser.cpp
+++ b/third_party/WebKit/Source/core/xml/XPathParser.cpp
@@ -106,13 +106,12 @@ static bool isAxisName(const String& name, Step::Axis& type)
static bool isNodeTypeName(const String& name)
{
- DEFINE_STATIC_LOCAL(HashSet<String>, nodeTypeNames, ());
- if (nodeTypeNames.isEmpty()) {
- nodeTypeNames.add("comment");
- nodeTypeNames.add("text");
- nodeTypeNames.add("processing-instruction");
- nodeTypeNames.add("node");
- }
+ DEFINE_STATIC_LOCAL(HashSet<String>, nodeTypeNames, ({
+ "comment",
+ "text",
+ "processing-instruction",
+ "node",
+ }));
return nodeTypeNames.contains(name);
}

Powered by Google App Engine
This is Rietveld 408576698