summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm20
1 files changed, 9 insertions, 11 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index fa4d1abbf5e..75027dfdd23 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -2961,28 +2961,26 @@ sub sort_uniq {
}
-=item C<push_uniq(\@list, @items)>
+=item C<push_uniq(\@list, @new_items)>
-The C<push_uniq> function pushes the last elements on the list referenced
-by the first argument.
+The C<push_uniq> function pushes the last argument @ITEMS to the $LIST
+referenced by the first argument, if they are not already in the list.
=cut
sub push_uniq {
- # can't we use $l as a reference, and then use my? later ...
- local (*l, @le) = @_;
- foreach my $e (@le) {
- if (! &member($e, @l)) {
- push @l, $e;
+ my ($l, @new_items) = @_;
+ for my $e (@new_items) {
+ if (! &member($e, @$l)) {
+ push (@$l, $e);
}
}
}
-
=item C<member($item, @list)>
-The C<member> function returns true if the the first argument is contained
-in the list of the remaining arguments.
+The C<member> function returns true if the first argument
+is also inclued in the list of the remaining arguments.
=cut