Issue #7300 has been updated by knu (Akinori MUSHA).


???????????????????緇????????鴻?c?????

Hash[enum.map {|x| x > 0 ? [x, x*x] : nil }.compact] # minimum change
Hash[*enum.flat_map {|x| x > 0 ? [x, x*x] : [] }] # 1.9+ only
{}.tap { |h| enum.each {|x| x > 0 and h[x] = x*x } }

??с?????
----------------------------------------
Bug #7300: Hash#[] ?????????? 1.9.3 ???違??c??????
https://bugs.ruby-lang.org/issues/7300#change-32548

Author: hsbt (Hiroshi SHIBATA)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-11-07) [x86_64-darwin12.2.0]


Hash[[nil]] ???絎?茵?????????? 1.9.3 ??с?? {} ???????????? 2.0.0 ??с?? ArgumentError ???????障?????

????????????????梧????????帥????????2.0.0 ??????????筝?罩c????????????с?????????罩???????????????
???????????????????????????????障???????????2.0.0 ??с?? dupricate ??茘?????????????????
罨<????若?鴻?ф??????????????鴻?????????????????????障?????


-- 
http://bugs.ruby-lang.org/