We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3f1164e + 96590b8 commit df2eb9dCopy full SHA for df2eb9d
macros/core/PGbasicmacros.pl
@@ -2634,13 +2634,9 @@ =head2 Sorting and other list macros
2634
2635
# uniq gives unique elements of a list:
2636
sub uniq {
2637
- my @in = @_;
2638
- my %temp = ();
2639
- while (@in) {
2640
- $temp{ shift(@in) }++;
2641
- }
2642
- my @out = keys %temp; # sort is causing trouble with Safe.??
2643
- @out;
+ my @in = @_;
+ my %seen;
+ return grep { !$seen{$_}++ } @in;
2644
}
2645
2646
sub lex_sort {
0 commit comments