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

Side by Side Diff: third_party/WebKit/Source/core/xml/XPathPath.cpp

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: Created 3 years, 11 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 (C) 2005 Frerich Raabe <raabe@kde.org> 2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org>
3 * Copyright (C) 2006, 2009 Apple Inc. 3 * Copyright (C) 2006, 2009 Apple 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 newNodes->markSubtreesDisjoint(true); 138 newNodes->markSubtreesDisjoint(true);
139 139
140 for (const auto& inputNode : nodes) { 140 for (const auto& inputNode : nodes) {
141 NodeSet* matches = NodeSet::create(); 141 NodeSet* matches = NodeSet::create();
142 step->evaluate(context, inputNode, *matches); 142 step->evaluate(context, inputNode, *matches);
143 143
144 if (!matches->isSorted()) 144 if (!matches->isSorted())
145 resultIsSorted = false; 145 resultIsSorted = false;
146 146
147 for (const auto& node : *matches) { 147 for (const auto& node : *matches) {
148 if (!needToCheckForDuplicateNodes || newNodesSet.add(node).isNewEntry) 148 if (!needToCheckForDuplicateNodes ||
149 newNodesSet.insert(node).isNewEntry)
149 newNodes->append(node); 150 newNodes->append(node);
150 } 151 }
151 } 152 }
152 153
153 nodes.swap(*newNodes); 154 nodes.swap(*newNodes);
154 } 155 }
155 156
156 nodes.markSorted(resultIsSorted); 157 nodes.markSorted(resultIsSorted);
157 } 158 }
158 159
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 194
194 NodeSet& nodes = v.modifiableNodeSet(context); 195 NodeSet& nodes = v.modifiableNodeSet(context);
195 m_path->evaluate(context, nodes); 196 m_path->evaluate(context, nodes);
196 197
197 return v; 198 return v;
198 } 199 }
199 200
200 } // namespace XPath 201 } // namespace XPath
201 202
202 } // namespace blink 203 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/xml/XPathParser.cpp ('k') | third_party/WebKit/Source/core/xml/XPathPredicate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698