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

lzz_1024 · June 29, 2020 · Last by lzz_1024 replied at June 29, 2020 · 2026 hits

各位大大,请问下 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.

非常感谢

You need to Sign in before reply, if you don't have an account, please Sign up first.