summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2008-02-02 05:42:33 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2008-02-02 05:42:33 -0500
commitc25bb1bd704d55b25d8009968d29a82ca3a45d72 (patch)
tree47575316bc30a9f1bad5bb68d5ea85db25c061aa
parent7e1056629c29d99e75db4dd82b29c0eddb954a4d (diff)
downloadgames-word-c25bb1bd704d55b25d8009968d29a82ca3a45d72.tar.gz
games-word-c25bb1bd704d55b25d8009968d29a82ca3a45d72.zip
make sure we don't catch 0 here
-rw-r--r--lib/Games/Word.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Games/Word.pm b/lib/Games/Word.pm
index 46129a7..e51d865 100644
--- a/lib/Games/Word.pm
+++ b/lib/Games/Word.pm
@@ -16,7 +16,7 @@ use Test::Deep::NoTest;
sub random_permutation {
my $word = shift;
- return '' unless $word;
+ return '' if $word eq '';
my $letter = substr $word, int(rand length $word), 1, '';
@@ -115,7 +115,7 @@ sub random_string_from {
sub is_substring {
my ($substring, $string) = @_;
- return 1 unless $substring;
+ return 1 if $substring eq '';
my $re = join('?', map { quotemeta } split(//, $string)) . '?';
return $substring =~ $re;
}
@@ -123,7 +123,7 @@ sub is_substring {
sub all_substrings {
my $string = shift;
- return ('') unless $string;
+ return ('') if $string eq '';
my @substrings = ($string);
my $before = '';