In my instance, I’ve got a reference set of hashes that I’m pointing to
from multiple arrays. Those arrays are manipulated depending on sorting
and other factors.
I don’t want to get Hash#== involved so I’m using the Hash object id’s.
After processing is completed, I’d like to get back from the IDs to the
object references. The lookup is working, but I was wondering if there
was a better method.
In my instance, I’ve got a reference set of hashes that I’m pointing to
from multiple arrays. Those arrays are manipulated depending on sorting
and other factors.
I don’t want to get Hash#== involved so I’m using the Hash object id’s.
After processing is completed, I’d like to get back from the IDs to the
object references. The lookup is working, but I was wondering if there
was a better method.
In my instance, I’ve got a reference set of hashes that I’m
pointing to from multiple arrays. Those arrays are manipulated
depending on sorting and other factors.
I don’t want to get Hash#== involved so I’m using the Hash
object id’s. After processing is completed, I’d like to get
back from the IDs to the object references. The lookup is
working, but I was wondering if there was a better method.
Not seeing the internals of your code, will Object#equal? (identical
object ids) be able to replace #==?
Yes, the code similar to the above example works as-is with the
hash ids, as I wanted to avoid Hash#== and all the comparisons it
will perform. Judging by the replies so far, I think I’ll keep
the lookup hash.