Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Refactoring just to refactor?

by jwkrahn (Abbot)
on Jun 28, 2019 at 19:14 UTC ( [id://11102094]=note: print w/replies, xml ) Need Help??


in reply to Refactoring just to refactor?

map { anchor( textify($_), { href => $_ } ) } grep { /^[A-Z].+/ && -f $_ } sort { article_sort($a, $b) }

If possible, I would put the grep before the sort so that you probably have fewer items to sort which takes less time. (more efficient):

map { anchor( textify($_), { href => $_ } ) } sort { article_sort($a, $b) } grep { /^[A-Z].+/ && -f $_ }

Replies are listed 'Best First'.
Re^2: Refactoring just to refactor?
by Lady_Aleena (Priest) on Jun 28, 2019 at 22:25 UTC

    I was thinking about putting grep before sort. With the lists being less than 20 items (more like 4 or 5), it does not make too big a difference.

    No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
    Lady Aleena

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-19 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found