阅读背景:

检查nil和更新哈希值的最佳方法

来源:互联网 

I have a hash where the values are all arrays. I want to look up a key in this hash. If it exists I want to add a value to the array. If it does not exist (hash[key] returns nil) then I need to create the array and and add one value. Currently I have this:I have a hash where the values are all arrays.




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: