in reply to RE: A discriminating sort (and some damned lies)
in thread A discriminating sort (and some damned lies)
Yeah, obviously the difference isn't huge by any measure. The return s perhaps offer that minimal speed gain by potentially decreasing the number of operations in the sorting sub.
Re: exists vs. defined. Clearly these test for different things (for onlookers, whether a key exists in a hash, and whether the value in the hash corresponding to the key has been defined), and there are obviously contexts in which it would be an error to confuse them. But if you keep a tight rein on your hash (as was done in the code above), there's no functional difference here : $last{"not other"} fed to either function is going to return a false value. I suppose that forcing you to keep a tight rein on your hash could be your worry, but if your code (not Fastolfe in particular, of course!) is creating hash keys that you're not aware of, you're probably in trouble anyway =)
Or am I missing something? (does, e.g. calling defined $hash{$key} create an entry for $key in $hash)?
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: RE: A discriminating sort (and some damned lies)
by Fastolfe (Vicar) on Nov 03, 2000 at 20:22 UTC |