Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Uniqueue

by RMGir (Prior)
on Aug 29, 2002 at 19:05 UTC ( #193862=note: print w/replies, xml ) Need Help??

in reply to Uniqueue

I'm curious, why did you use delete instead of overwriting the hash ref? This:
delete @{$self->{'hash'}}{ keys %{$self->{'hash'}} };
must be less efficient than this:
Are you worried about someone else having a reference to the same hash?

Replies are listed 'Best First'.
Re: Re: Uniqueue
by Zaxo (Archbishop) on Aug 29, 2002 at 20:00 UTC

    Heh, even brand new code has cruft. That was a leftover which had been the last line, providing the list of values to return. I decided that was no good without keeping their order, but the delete line never got changed. Thanks!

    The line in question, #38 in the clear method, is replaced with RMGir's suggested one. That makes the hash values no longer significant, so assignments to them have been changed to a ++ bump. $VERSION incremented and RMGir credited.

    After Compline,

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://193862]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2023-03-31 19:52 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (76 votes). Check out past polls.