| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |