Browse files

Optimize lexical out of hot loop in "uniq"

And I've now given up on using grep{} in uniq(), the tests succeeed, but strange
unrelated things change, like giving the wrong error message:
$ perl6 -e 'Module.new'
===SORRY!===
Cannot assign a non-Perl 6 value to a Perl 6 container
  • Loading branch information...
1 parent ce8b5f6 commit f60a2c111efe9a647d73ca641fcedea874e0f79d @lizmat lizmat committed Jul 3, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/core/List.pm
View
3 src/core/List.pm
@@ -326,8 +326,9 @@ my class List does Positional {
# specifier, but AFAIK nothing has been spec'd yet.
method uniq() {
my $seen := nqp::hash();
+ my str $which;
gather sink for @.list {
- my str $which = nqp::unbox_s($_.WHICH);
+ $which = nqp::unbox_s($_.WHICH);
unless nqp::existskey($seen, $which) {
take $_;
nqp::bindkey($seen, $which, 1);

0 comments on commit f60a2c1

Please sign in to comment.