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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2005 Maksim Orlovich <maksim@kde.org> 2 * Copyright 2005 Maksim Orlovich <maksim@kde.org>
3 * Copyright (C) 2006 Apple Computer, Inc. 3 * Copyright (C) 2006 Apple Computer, Inc.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 AxisNamesMap::iterator it = axisNames.find(name); 100 AxisNamesMap::iterator it = axisNames.find(name);
101 if (it == axisNames.end()) 101 if (it == axisNames.end())
102 return false; 102 return false;
103 type = it->value; 103 type = it->value;
104 return true; 104 return true;
105 } 105 }
106 106
107 static bool isNodeTypeName(const String& name) 107 static bool isNodeTypeName(const String& name)
108 { 108 {
109 DEFINE_STATIC_LOCAL(HashSet<String>, nodeTypeNames, ()); 109 DEFINE_STATIC_LOCAL(HashSet<String>, nodeTypeNames, ({
110 if (nodeTypeNames.isEmpty()) { 110 "comment",
111 nodeTypeNames.add("comment"); 111 "text",
112 nodeTypeNames.add("text"); 112 "processing-instruction",
113 nodeTypeNames.add("processing-instruction"); 113 "node",
114 nodeTypeNames.add("node"); 114 }));
115 }
116 return nodeTypeNames.contains(name); 115 return nodeTypeNames.contains(name);
117 } 116 }
118 117
119 // Returns whether the current token can possibly be a binary operator, given 118 // Returns whether the current token can possibly be a binary operator, given
120 // the previous token. Necessary to disambiguate some of the operators 119 // the previous token. Necessary to disambiguate some of the operators
121 // (* (multiply), div, and, or, mod) in the [32] Operator rule 120 // (* (multiply), div, and, or, mod) in the [32] Operator rule
122 // (check http://www.w3.org/TR/xpath#exprlex). 121 // (check http://www.w3.org/TR/xpath#exprlex).
123 bool Parser::isBinaryOperatorContext() const 122 bool Parser::isBinaryOperatorContext() const
124 { 123 {
125 switch (m_lastTokenType) { 124 switch (m_lastTokenType) {
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 505
507 void Parser::deleteString(String* s) 506 void Parser::deleteString(String* s)
508 { 507 {
509 if (s == 0) 508 if (s == 0)
510 return; 509 return;
511 510
512 ASSERT(m_strings.contains(s)); 511 ASSERT(m_strings.contains(s));
513 512
514 m_strings.remove(s); 513 m_strings.remove(s);
515 } 514 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698