aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-27 06:49:27 +0000
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-27 06:49:27 +0000
commit9d6d8e93f8a45750a40645a4bdb7dec73d6ad6fe (patch)
tree3152c5ae1b303b677bb2331b863ace437f7e7db2
parentd1562fd068dfefd8bd75d53d098d587456c8c664 (diff)
downloadruby-9d6d8e93f8a45750a40645a4bdb7dec73d6ad6fe.tar.gz
csv.rb: use Array#to_h
* lib/csv.rb (CSV::Row#to_hash): use Array#to_h git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/csv.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/csv.rb b/lib/csv.rb
index c93c8f9ec3..75f444e461 100644
--- a/lib/csv.rb
+++ b/lib/csv.rb
@@ -532,8 +532,7 @@ class CSV
# order and clobbers duplicate fields.
#
def to_hash
- # flatten just one level of the internal Array
- Hash[*@row.inject(Array.new) { |ary, pair| ary.push(*pair) }]
+ @row.to_h
end
#