Hash#keys, Hash#values order question

R

Ronald Fischer

Let h be a Hash. Calculating the arrays

k=3Dh.keys
v=3Dh.values

under the assumption that h is not modified
in between, is it guaranteed that for all
indices n

h[k[n]]=3D=3Dv[n]

i.e. that Hash#values delivers the values
in the same order than Hash#keys delivers
the respective keys?

When playing around, I found this always
the case, but can I rely on it?

Ronald
--=20
Ronald Fischer <[email protected]>
Phone: +49-89-452133-162
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top