Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix triangle metaops on empty lists (TimToady++).
  • Loading branch information
pmichaud committed Aug 3, 2011
1 parent 120d3be commit f72544a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/metaops.pm
Expand Up @@ -53,8 +53,8 @@ sub METAOP_REDUCE(\$op, :$triangle) {
my $x :=
sub (*@values) {
if $triangle {
return () unless @values;
GATHER({
return unless @values;
my $result := @values.shift;
take $result;
take ($result := $op($result, @values.shift))
Expand All @@ -77,8 +77,8 @@ sub METAOP_REDUCE_RIGHT(\$op, :$triangle) {
sub (*@values) {
my $list = @values.reverse;
if $triangle {
return () unless $list;
gather {
return unless $list;
my $result := $list.shift;
take $result;
take ($result := $op($list.shift, $result))
Expand Down

0 comments on commit f72544a

Please sign in to comment.