diff options
| author | drbaggy <js5@sanger.ac.uk> | 2021-06-08 11:27:54 +0100 |
|---|---|---|
| committer | drbaggy <js5@sanger.ac.uk> | 2021-06-08 11:27:54 +0100 |
| commit | 7a0359becf22d29deacefbcb1372ecc484f2e926 (patch) | |
| tree | 01b561966fd3e6f9fcb2a58f9ef8a69cd56249c2 /challenge-116/james-smith/perl | |
| parent | edebac2ae86d348d1a495805993d92cd9d61fa0c (diff) | |
| download | perlweeklychallenge-club-7a0359becf22d29deacefbcb1372ecc484f2e926.tar.gz perlweeklychallenge-club-7a0359becf22d29deacefbcb1372ecc484f2e926.tar.bz2 perlweeklychallenge-club-7a0359becf22d29deacefbcb1372ecc484f2e926.zip | |
remove unncessary inequality
Diffstat (limited to 'challenge-116/james-smith/perl')
| -rw-r--r-- | challenge-116/james-smith/perl/ch-1.pl | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/challenge-116/james-smith/perl/ch-1.pl b/challenge-116/james-smith/perl/ch-1.pl index b3e2eaeba4..cdd0b29cc4 100644 --- a/challenge-116/james-smith/perl/ch-1.pl +++ b/challenge-116/james-smith/perl/ch-1.pl @@ -45,7 +45,7 @@ sub splitnum { ## it is equal to or larger than the input number ($string .= ++$end) && push @range, $end - while $in gt $string && length $in > length $string; + while length $in > length $string; ## Finally we return the list if the input and ## string are the same. Note we will always get @@ -70,8 +70,7 @@ sub splitnum_no_comments { my( $in, $st ) = ( shift, '' ); for( split //, substr $in, 0, (length $in) >> 1) { my @r = ( my $t = my $en = $st .= $_ ); - ($t .= ++$en) && push @r,$en while $in gt $t - && length $in > length $t; + ($t .= ++$en) && push @r,$en while length $in > length $t; return \@r if $t eq $in; } return [$in]; |
