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

ruby-changes:34890

From: hsbt <ko1@a...>
Date: Sun, 27 Jul 2014 20:04:49 +0900 (JST)
Subject: [ruby-changes:34890] hsbt:r46973 (trunk): * lib/cgi/core.rb: remove unused variables.

hsbt	2014-07-27 20:04:28 +0900 (Sun, 27 Jul 2014)

  New Revision: 46973

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

  Log:
    * lib/cgi/core.rb: remove unused variables.
    * lib/erb.rb: ditto.
    * lib/mkmf.rb: ditto.
    * lib/net/http/response.rb: ditto.
    * lib/optparse/version.rb: ditto.
    * lib/prime.rb: ditto.
    * lib/racc/parser.rb: ditto.
    * lib/rexml/document.rb: ditto.
    * lib/rexml/dtd/dtd.rb: ditto.
    * lib/rexml/element.rb: ditto.
    * lib/rexml/functions.rb: ditto.
    * lib/rexml/parsers/xpathparser.rb: ditto.

  Modified files:
    trunk/ChangeLog
    trunk/lib/cgi/core.rb
    trunk/lib/erb.rb
    trunk/lib/mkmf.rb
    trunk/lib/net/http/response.rb
    trunk/lib/optparse/version.rb
    trunk/lib/prime.rb
    trunk/lib/racc/parser.rb
    trunk/lib/rexml/document.rb
    trunk/lib/rexml/dtd/dtd.rb
    trunk/lib/rexml/element.rb
    trunk/lib/rexml/functions.rb
    trunk/lib/rexml/parsers/xpathparser.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46972)
+++ ChangeLog	(revision 46973)
@@ -1,3 +1,18 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Jul 27 19:49:36 2014  SHIBATA Hiroshi  <shibata.hiroshi@g...>
+
+	* lib/cgi/core.rb: remove unused variables.
+	* lib/erb.rb: ditto.
+	* lib/mkmf.rb: ditto.
+	* lib/net/http/response.rb: ditto.
+	* lib/optparse/version.rb: ditto.
+	* lib/prime.rb: ditto.
+	* lib/racc/parser.rb: ditto.
+	* lib/rexml/document.rb: ditto.
+	* lib/rexml/dtd/dtd.rb: ditto.
+	* lib/rexml/element.rb: ditto.
+	* lib/rexml/functions.rb: ditto.
+	* lib/rexml/parsers/xpathparser.rb: ditto.
+
 Sun Jul 27 05:11:21 2014  Zachary Scott  <e@z...>
 
 	* lib/irb.rb: [DOC] PROMPT_I cannot be nil, patch by @hgillane
Index: lib/rexml/parsers/xpathparser.rb
===================================================================
--- lib/rexml/parsers/xpathparser.rb	(revision 46972)
+++ lib/rexml/parsers/xpathparser.rb	(revision 46973)
@@ -21,7 +21,7 @@ module REXML https://github.com/ruby/ruby/blob/trunk/lib/rexml/parsers/xpathparser.rb#L21
         path.gsub!(/([\(\[])\s+/, '\1') # Strip ignorable spaces
         path.gsub!( /\s+([\]\)])/, '\1')
         parsed = []
-        path = OrExpr(path, parsed)
+        OrExpr(path, parsed)
         parsed
       end
 
Index: lib/rexml/document.rb
===================================================================
--- lib/rexml/document.rb	(revision 46972)
+++ lib/rexml/document.rb	(revision 46973)
@@ -123,7 +123,7 @@ module REXML https://github.com/ruby/ruby/blob/trunk/lib/rexml/document.rb#L123
     def xml_decl
       rv = @children[0]
       return rv if rv.kind_of? XMLDecl
-      rv = @children.unshift(XMLDecl.default)[0]
+      @children.unshift(XMLDecl.default)[0]
     end
 
     # @return the XMLDecl version of this document as a String.
Index: lib/rexml/element.rb
===================================================================
--- lib/rexml/element.rb	(revision 46972)
+++ lib/rexml/element.rb	(revision 46973)
@@ -1181,9 +1181,8 @@ module REXML https://github.com/ruby/ruby/blob/trunk/lib/rexml/element.rb#L1181
         prefix = '' unless prefix
       end
       old = fetch(name, nil)
-      attr = nil
       if old.kind_of? Hash # the supplied attribute is one of many
-        attr = old.delete(prefix)
+        old.delete(prefix)
         if old.size == 1
           repl = nil
           old.each_value{|v| repl = v}
@@ -1192,7 +1191,6 @@ module REXML https://github.com/ruby/ruby/blob/trunk/lib/rexml/element.rb#L1191
       elsif old.nil?
         return @element
       else # the supplied attribute is a top-level one
-        attr = old
         super(name)
       end
       @element
Index: lib/rexml/functions.rb
===================================================================
--- lib/rexml/functions.rb	(revision 46972)
+++ lib/rexml/functions.rb	(revision 46973)
@@ -363,7 +363,7 @@ module REXML https://github.com/ruby/ruby/blob/trunk/lib/rexml/functions.rb#L363
 
     def Functions::sum( nodes )
       nodes = [nodes] unless nodes.kind_of? Array
-      nodes.inject(0) { |r,n| r += number(string(n)) }
+      nodes.inject(0) { |r,n| r + number(string(n)) }
     end
 
     def Functions::floor( number )
Index: lib/rexml/dtd/dtd.rb
===================================================================
--- lib/rexml/dtd/dtd.rb	(revision 46972)
+++ lib/rexml/dtd/dtd.rb	(revision 46973)
@@ -24,23 +24,18 @@ module REXML https://github.com/ruby/ruby/blob/trunk/lib/rexml/dtd/dtd.rb#L24
           case input
           when ElementDecl.PATTERN_RE
             match = $&
-            source = $'
             contents << ElementDecl.new( match )
           when AttlistDecl.PATTERN_RE
             matchdata = $~
-            source = $'
             contents << AttlistDecl.new( matchdata )
           when EntityDecl.PATTERN_RE
             matchdata = $~
-            source = $'
             contents << EntityDecl.new( matchdata )
           when Comment.PATTERN_RE
             matchdata = $~
-            source = $'
             contents << Comment.new( matchdata )
           when NotationDecl.PATTERN_RE
             matchdata = $~
-            source = $'
             contents << NotationDecl.new( matchdata )
           end
         end
Index: lib/mkmf.rb
===================================================================
--- lib/mkmf.rb	(revision 46972)
+++ lib/mkmf.rb	(revision 46973)
@@ -667,7 +667,6 @@ SRC https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L667
         return nil
       end
       upper = 1
-      lower = 0
       until try_static_assert("#{const} <= #{upper}", headers, opt)
         lower = upper
         upper <<= 1
@@ -2253,7 +2252,7 @@ static: $(STATIC_LIB)#{$extout ? " insta https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2252
       fseprepl = proc {|s|
         s = s.gsub("/", fsep)
         s = s.gsub(/(\$\(\w+)(\))/) {$1+sep+$2}
-        s = s.gsub(/(\$\{\w+)(\})/) {$1+sep+$2}
+        s.gsub(/(\$\{\w+)(\})/) {$1+sep+$2}
       }
       rsep = ":#{fsep}=/"
     else
Index: lib/optparse/version.rb
===================================================================
--- lib/optparse/version.rb	(revision 46972)
+++ lib/optparse/version.rb	(revision 46973)
@@ -51,7 +51,7 @@ class << OptionParser https://github.com/ruby/ruby/blob/trunk/lib/optparse/version.rb#L51
       raise NameError, path unless Module === klass
       klass.constants.grep(/#{name}/i) do |c|
         klass.const_defined?(c) or next
-        c = klass.const_get(c)
+        klass.const_get(c)
       end
     end
   end
Index: lib/cgi/core.rb
===================================================================
--- lib/cgi/core.rb	(revision 46972)
+++ lib/cgi/core.rb	(revision 46973)
@@ -479,7 +479,6 @@ class CGI https://github.com/ruby/ruby/blob/trunk/lib/cgi/core.rb#L479
       @files = {}
       boundary_rexp = /--#{Regexp.quote(boundary)}(#{EOL}|--)/
       boundary_size = "#{EOL}--#{boundary}#{EOL}".bytesize
-      boundary_end  = nil
       buf = ''
       bufsize = 10 * 1024
       max_count = MAX_MULTIPART_COUNT
Index: lib/erb.rb
===================================================================
--- lib/erb.rb	(revision 46972)
+++ lib/erb.rb	(revision 46973)
@@ -717,7 +717,7 @@ class ERB https://github.com/ruby/ruby/blob/trunk/lib/erb.rb#L717
         comment = $1 if comment[/-\*-\s*(.*?)\s*-*-$/]
         if %r"coding\s*[=:]\s*([[:alnum:]\-_]+)" =~ comment
           enc = $1.sub(/-(?:mac|dos|unix)/i, '')
-          enc = Encoding.find(enc)
+          Encoding.find(enc)
         end
       end
     end
Index: lib/prime.rb
===================================================================
--- lib/prime.rb	(revision 46972)
+++ lib/prime.rb	(revision 46973)
@@ -180,7 +180,7 @@ class Prime https://github.com/ruby/ruby/blob/trunk/lib/prime.rb#L180
   #   Prime.int_from_prime_division([[2,2], [3,1]])  #=> 12
   def int_from_prime_division(pd)
     pd.inject(1){|value, (prime, index)|
-      value *= prime**index
+      value * prime**index
     }
   end
 
Index: lib/net/http/response.rb
===================================================================
--- lib/net/http/response.rb	(revision 46972)
+++ lib/net/http/response.rb	(revision 46973)
@@ -306,7 +306,6 @@ class Net::HTTPResponse https://github.com/ruby/ruby/blob/trunk/lib/net/http/response.rb#L306
   # See RFC 2616 section 3.6.1 for definitions
 
   def read_chunked(dest, chunk_data_io) # :nodoc:
-    len = nil
     total = 0
     while true
       line = @socket.readline
Index: lib/racc/parser.rb
===================================================================
--- lib/racc/parser.rb	(revision 46972)
+++ lib/racc/parser.rb	(revision 46973)
@@ -380,7 +380,6 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/parser.rb#L380
       _,   _, _, _,
       _,   _, _, shift_n,  reduce_n,
       _,   _, * = arg
-      nerr = 0   # tmp
 
       if act > 0 and act < shift_n
         #
@@ -431,7 +430,6 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/parser.rb#L430
         case @racc_error_status
         when 0
           unless arg[21]    # user_yyerror
-            nerr += 1
             on_error @racc_t, @racc_val, @racc_vstack
           end
         when 3

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

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