diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-27 11:04:28 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-27 11:04:28 +0000 |
commit | 448c87008e1bc66a93b8f21eedea060f281874a4 (patch) | |
tree | 8fe301a34d41515d719359c0df2e427463f75ca3 /lib/rexml | |
parent | 42425c89a4ab06faea75d722e1faeddcf3bcad4c (diff) |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml')
-rw-r--r-- | lib/rexml/document.rb | 2 | ||||
-rw-r--r-- | lib/rexml/dtd/dtd.rb | 5 | ||||
-rw-r--r-- | lib/rexml/element.rb | 4 | ||||
-rw-r--r-- | lib/rexml/functions.rb | 2 | ||||
-rw-r--r-- | lib/rexml/parsers/xpathparser.rb | 2 |
5 files changed, 4 insertions, 11 deletions
diff --git a/lib/rexml/document.rb b/lib/rexml/document.rb index 1e18263dda..8342b96e6a 100644 --- a/lib/rexml/document.rb +++ b/lib/rexml/document.rb @@ -123,7 +123,7 @@ module REXML 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. diff --git a/lib/rexml/dtd/dtd.rb b/lib/rexml/dtd/dtd.rb index 966e39ea57..62317bac9e 100644 --- a/lib/rexml/dtd/dtd.rb +++ b/lib/rexml/dtd/dtd.rb @@ -24,23 +24,18 @@ module REXML 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 diff --git a/lib/rexml/element.rb b/lib/rexml/element.rb index 94b00d7284..e459704d3c 100644 --- a/lib/rexml/element.rb +++ b/lib/rexml/element.rb @@ -1181,9 +1181,8 @@ module REXML 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 elsif old.nil? return @element else # the supplied attribute is a top-level one - attr = old super(name) end @element diff --git a/lib/rexml/functions.rb b/lib/rexml/functions.rb index 20c8961aee..2010be14e0 100644 --- a/lib/rexml/functions.rb +++ b/lib/rexml/functions.rb @@ -363,7 +363,7 @@ module REXML 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 ) diff --git a/lib/rexml/parsers/xpathparser.rb b/lib/rexml/parsers/xpathparser.rb index e643d11511..d30aa34f6e 100644 --- a/lib/rexml/parsers/xpathparser.rb +++ b/lib/rexml/parsers/xpathparser.rb @@ -21,7 +21,7 @@ module REXML path.gsub!(/([\(\[])\s+/, '\1') # Strip ignorable spaces path.gsub!( /\s+([\]\)])/, '\1') parsed = [] - path = OrExpr(path, parsed) + OrExpr(path, parsed) parsed end |