-
-
Save Mouq/e6ab6ff6acbfbc6dd032 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/core/set_operators.pm b/src/core/set_operators.pm | |
index aaf654e..d3fa24e 100644 | |
--- a/src/core/set_operators.pm | |
+++ b/src/core/set_operators.pm | |
@@ -123,13 +123,13 @@ only sub infix:<(-)>(**@p) { | |
} | |
$baghash.Bag(:view); | |
} else { | |
- my $sethash = nqp::istype(@p[0],SetHash) | |
- ?? SetHash.new(@p.shift.keys) | |
- !! @p.shift.SetHash; | |
- for @p.map(*.Set(:view)) -> $set { | |
- $set{$_} && $sethash.DELETE-KEY($_) for $sethash.keys; | |
- } | |
- $sethash.Set(:view); | |
+ my $start-set = @p.shift.Set(:view); | |
+ my $minus-set = @p == 1 | |
+ ?? @p[0].Set(:view) | |
+ !! Set.new(eager @p.map(*.Set(:view).keys)); | |
+ Set.new(eager $start-set.keys.grep: { | |
+ not $minus-set{$_} | |
+ }); | |
} | |
} | |
# U+2216 SET MINUS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment