Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
No need to check all parameters passed, the first will do
  • Loading branch information
lizmat committed Sep 9, 2013
1 parent 9b4d4e1 commit 437e799
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Setty.pm
Expand Up @@ -132,7 +132,7 @@ only sub infix:<<"\x220C">>($a, $b --> Bool) {

only sub infix:<(|)>(**@p) {
my $set = Set.new: @p.map(*.Set.keys);
if @p.grep(Baggy) {
if @p.first(Baggy) {
my @bags = @p.map(*.Bag);
Bag.new-fp($set.map({ ; $_ => [max] @bags>>.{$_} }));
}
Expand All @@ -146,7 +146,7 @@ only sub infix:<<"\x222A">>(|p) {
}

only sub infix:<(&)>(**@p) {
if @p.grep(Baggy) {
if @p.first(Baggy) {
my $keybag = @p ?? @p.shift.KeyBag !! KeyBag.new;
for @p.map(*.Bag) -> $bag {
$bag{$_}
Expand Down

1 comment on commit 437e799

@BenGoldberg1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a lazy list (such as produced by grep) is used in boolean context, only one element is reified.
Thus, this change from grep to first doesn't change anything.

Please sign in to comment.