[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

maximum size of hash key?

Esmail

3/3/2008 11:08:00 AM

Hi,

Is there a maximum size for the key in a hash? If I
am using an array or a string as the key, will I run
into trouble if the data is too big? How big?

EB
2 Answers

Robert Klemme

3/3/2008 7:23:00 PM

0

On 03.03.2008 12:07, Esmail wrote:
> Is there a maximum size for the key in a hash? If I
> am using an array or a string as the key, will I run
> into trouble if the data is too big? How big?

There is no such limit. There are just the published requirements for
Hash keys. And keep in mind that it's usually a bad idea to mutate a
hash key - at least you need to rehash afterwards.

You should probably make yourself familiar with reference semantics.
The Hash only stores references to objects - for keys and values.

Kind regards

robert

Esmail

3/3/2008 9:12:00 PM

0

As always, thank you Robert for an informative post.