aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rexml
diff options
context:
space:
mode:
authorKouhei Sutou <kou@clear-code.com>2019-01-01 05:36:39 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-04 11:54:11 +0900
commit096e766355f36983676883b7cb83a1b5862be49a (patch)
tree26c0409bf1348927ea8f56fe3be6afca78e57557 /lib/rexml
parent27c11892c829a249b997f896b29cdf26ac9f38f2 (diff)
downloadruby-096e766355f36983676883b7cb83a1b5862be49a.tar.gz
[ruby/rexml] xpath: remove needless nil check
It must not be nil. https://github.com/ruby/rexml/commit/61b73c1bf8
Diffstat (limited to 'lib/rexml')
-rw-r--r--lib/rexml/xpath_parser.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/rexml/xpath_parser.rb b/lib/rexml/xpath_parser.rb
index 47fa4ef84e..df9e7d58ff 100644
--- a/lib/rexml/xpath_parser.rb
+++ b/lib/rexml/xpath_parser.rb
@@ -474,9 +474,7 @@ module REXML
raw_node = node.raw_node
case raw_node.node_type
when :element
- if prefix.nil?
- raw_node.name == name
- elsif prefix.empty?
+ if prefix.empty?
if strict?
raw_node.name == name and raw_node.namespace == ""
else
@@ -490,9 +488,7 @@ module REXML
raw_node.name == name and raw_node.namespace == ns
end
when :attribute
- if prefix.nil?
- raw_node.name == name
- elsif prefix.empty?
+ if prefix.empty?
# FIXME: This DOUBLES the time XPath searches take
raw_node.name == name and
raw_node.namespace == raw_node.element.namespace