diff options
author | glass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-27 06:49:27 +0000 |
---|---|---|
committer | glass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-27 06:49:27 +0000 |
commit | 5e3f1a10ca9c109888083f7bd78fb1c94371b95c (patch) | |
tree | 3152c5ae1b303b677bb2331b863ace437f7e7db2 | |
parent | 11f69dccf3d9dd5e70f0f34546aab10b1f733ae1 (diff) | |
download | ruby-5e3f1a10ca9c109888083f7bd78fb1c94371b95c.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.rb | 3 |
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 # |