Skip to content

Commit 593620b

Browse files
committed
Optimize XPath step
If a predicate of xpath is position-independent, we don't need to create nodesets that has many duplicated nodes with different positions.
1 parent 7ac7ef4 commit 593620b

5 files changed

Lines changed: 474 additions & 245 deletions

File tree

lib/rexml/parsers/xpathparser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ def PrimaryExpr path, parsed
654654
contents = contents[1..-2]
655655
n = []
656656
OrExpr( contents, n )
657-
parsed.concat(n)
657+
parsed.concat([:parentheses, n])
658658
end
659659
path
660660
end

0 commit comments

Comments
 (0)