Skip to content

Commit

Permalink
Restore "uniq" to unstreamlined form, it messes up odd things
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jul 3, 2013
1 parent 5230d5a commit ce8b5f6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/core/List.pm
Expand Up @@ -326,11 +326,13 @@ my class List does Positional {
# specifier, but AFAIK nothing has been spec'd yet.
method uniq() {
my $seen := nqp::hash();
my str $which;
grep {
$which = nqp::unbox_s($_.WHICH);
nqp::bindkey($seen, $which, 1) unless nqp::existskey($seen, $which);
}, @.list;
gather sink for @.list {
my str $which = nqp::unbox_s($_.WHICH);
unless nqp::existskey($seen, $which) {
take $_;
nqp::bindkey($seen, $which, 1);
}
}
}

my @secret;
Expand Down

0 comments on commit ce8b5f6

Please sign in to comment.