Ruby Hash[*Array] 堆栈太深??

lzz_1024 · 2020年06月29日 · 最后由 lzz_1024 回复于 2020年06月29日 · 2025 次阅读

各位大大,请问下 Hash[*array] 的使用在 array 数据过大的情况下 stack level too deep (SystemStackError) 测试代码如下,自己写循环处理不会爆,直接 Hash[*array] 就爆了,想知道 hash 是怎么处理的

热心的群友已经解答了问题:https://stackoverflow.com/questions/33066859/why-am-i-getting-the-error-stack-level-too-deep-systemstackerror-when-hashin

The parameters are passed on the stack. If there are too many parameters, you'll exhaust stack space and get the mentioned error.

非常感谢

需要 登录 后方可回复, 如果你还没有账号请 注册新账号