aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2021-05-06 21:11:05 +0100
committerGitHub <noreply@github.com>2021-05-06 21:11:05 +0100
commit843d26fa9ae7073411890f5f027ff1f394479006 (patch)
treea5e811b6291e02801cc55b9bf593d3b6e2025a12
parentc0341484ecd54bec2289af736e595d60a9ba7124 (diff)
parent8c9455415a320bc055b1b2e07a1553c698bcb10b (diff)
downloadperlweeklychallenge-club-843d26fa9ae7073411890f5f027ff1f394479006.tar.gz
perlweeklychallenge-club-843d26fa9ae7073411890f5f027ff1f394479006.tar.bz2
perlweeklychallenge-club-843d26fa9ae7073411890f5f027ff1f394479006.zip
Merge pull request #4022 from PerlBoy1967/branch-for-challenge-111
Move from 'unpack' back to split('').
-rwxr-xr-xchallenge-111/perlboy1967/perl/ch-2.pl3
1 files changed, 1 insertions, 2 deletions
diff --git a/challenge-111/perlboy1967/perl/ch-2.pl b/challenge-111/perlboy1967/perl/ch-2.pl
index 3ca8cf7463..1b69c5013a 100755
--- a/challenge-111/perlboy1967/perl/ch-2.pl
+++ b/challenge-111/perlboy1967/perl/ch-2.pl
@@ -39,8 +39,7 @@ sub findLongestOrderedWords($) {
for my $word (sort { length($b) <=> length($a) } grep /^[a-z]+$/,@inWords) {
my $wlen = length($word);
if (!defined $wlenMax or $wlenMax == $wlen) {
- # Use unpack as it is slightly faster than split(//)
- if ($word eq join('',sort unpack '(A1)*',$word)) {
+ if ($word eq join('',sort split '',$word)) {
push(@words, $word);
$wlenMax = $wlen;
}