Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: speeding up a hash lookup

by physi (Friar)
on Mar 27, 2001 at 21:00 UTC ( [id://67536]=note: print w/replies, xml ) Need Help??


in reply to speeding up a hash lookup

I don't know if this is really faster, but a bit shorter:
sub getIntensity { my $mLo = $_[0] – 0.3; my $mHi = $_[0] + 0.3; my $intensity = 0; map { if ($_ >= $mLo && $_ <= $mHi) { $intesity = $massint{$_} > $intensity ? $massint{$_} : $inten +sity} } keys %massint; return $intensity; }
hope it help's :^)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2024-04-24 11:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found