diff options
author | Kouhei Sutou <[email protected]> | 2019-01-01 05:36:39 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2019-08-04 11:54:11 +0900 |
commit | 096e766355f36983676883b7cb83a1b5862be49a (patch) | |
tree | 26c0409bf1348927ea8f56fe3be6afca78e57557 | |
parent | 27c11892c829a249b997f896b29cdf26ac9f38f2 (diff) |
[ruby/rexml] xpath: remove needless nil check
It must not be nil.
https://github.com/ruby/rexml/commit/61b73c1bf8
-rw-r--r-- | lib/rexml/xpath_parser.rb | 8 |
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 |