Permalink
Browse files

clearer tests for odd indexes

  • Loading branch information...
2shortplanks committed May 15, 2012
1 parent b182b34 commit bfdc77bdf4d5ffcee5d3ab5b9aca15c9663309de
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Array/Windowed.pm
View
@@ -94,8 +94,8 @@ sub array_windowed(\@$$) {
### $first_index
### $last_index
- return [] unless $last_index >= 0;
- return [] unless $first_index <= $last_index;
+ return [] if $last_index < 0;
+ return [] if $first_index > $last_index;
return [@{$array_ref}[$first_index..$last_index]];
}
push @EXPORT_OK, "array_windowed";

0 comments on commit bfdc77b

Please sign in to comment.