Hash should raise a RuntimeError when rehashed during iteration
---------------------------------------------------------------

                 Key: JRUBY-1211
                 URL: http://jira.codehaus.org/browse/JRUBY-1211
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.0.0
            Reporter: Marcin Mielżyński


test case:

h = {1=>2}
h.each{h.rehash}

MRI:
`each': rehash occurred during iteration (RuntimeError)

h = {:foo=>:bar}
h.each{66.times{|i|h[i]=i}}

MRI:
`each': hash modified during iteration (RuntimeError)

66 is the threshold for MRI's first table reallocation
13 * 5 = 65 (prime * default density)



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to