aboutsummaryrefslogtreecommitdiff
path: root/challenge-116/james-smith/perl
diff options
context:
space:
mode:
authordrbaggy <js5@sanger.ac.uk>2021-06-08 11:27:54 +0100
committerdrbaggy <js5@sanger.ac.uk>2021-06-08 11:27:54 +0100
commit7a0359becf22d29deacefbcb1372ecc484f2e926 (patch)
tree01b561966fd3e6f9fcb2a58f9ef8a69cd56249c2 /challenge-116/james-smith/perl
parentedebac2ae86d348d1a495805993d92cd9d61fa0c (diff)
downloadperlweeklychallenge-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.pl5
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];