[前][次][番号順一覧][スレッド一覧]

ruby-changes:51104

From: kou <ko1@a...>
Date: Tue, 1 May 2018 12:12:42 +0900 (JST)
Subject: [ruby-changes:51104] kou:r63311 (trunk): rexml: Suppress warnings

kou	2018-05-01 12:12:37 +0900 (Tue, 01 May 2018)

  New Revision: 63311

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63311

  Log:
    rexml: Suppress warnings

  Modified files:
    trunk/lib/rexml/xpath_parser.rb
Index: lib/rexml/xpath_parser.rb
===================================================================
--- lib/rexml/xpath_parser.rb	(revision 63310)
+++ lib/rexml/xpath_parser.rb	(revision 63311)
@@ -434,7 +434,7 @@ module REXML https://github.com/ruby/ruby/blob/trunk/lib/rexml/xpath_parser.rb#L434
         while path_stack[0] == :predicate
           path_stack.shift # :predicate
           predicate_expression = path_stack.shift.dclone
-          nodesets = predicate(predicate_expression, nodesets)
+          nodesets = evaluate_predicate(predicate_expression, nodesets)
         end
         if nodesets.size == 1
           ordered_nodeset = nodesets[0]
@@ -578,7 +578,7 @@ module REXML https://github.com/ruby/ruby/blob/trunk/lib/rexml/xpath_parser.rb#L578
       new_nodeset
     end
 
-    def predicate(expression, nodesets)
+    def evaluate_predicate(expression, nodesets)
       # enter(:predicate, expression, nodesets)
       new_nodesets = nodesets.collect do |nodeset|
         new_nodeset = []
@@ -612,6 +612,7 @@ module REXML https://github.com/ruby/ruby/blob/trunk/lib/rexml/xpath_parser.rb#L612
         end
         new_nodeset
       end
+      new_nodesets
     # ensure
     #   leave(:predicate, new_nodesets)
     end
@@ -731,7 +732,6 @@ module REXML https://github.com/ruby/ruby/blob/trunk/lib/rexml/xpath_parser.rb#L732
 
     def following(node)
       followings = []
-      position = 1
       following_node = next_sibling_node(node)
       while following_node
         followings << XPathNode.new(following_node,
@@ -768,8 +768,8 @@ module REXML https://github.com/ruby/ruby/blob/trunk/lib/rexml/xpath_parser.rb#L768
         # trace(:child, node_type, node)
         case node_type
         when :element
-          nodesets << raw_node.children.collect.with_index do |node, i|
-            XPathNode.new(node, position: i + 1)
+          nodesets << raw_node.children.collect.with_index do |child_node, i|
+            XPathNode.new(child_node, position: i + 1)
           end
         when :document
           new_nodeset = []

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]