texlive[41618] Master/tlpkg/TeXLive/TLUtils.pm: (push_uniq): use my

commits+karl at tug.org commits+karl at tug.org
Mon Jul 4 01:33:11 CEST 2016


Revision: 41618
          http://tug.org/svn/texlive?view=revision&revision=41618
Author:   karl
Date:     2016-07-04 01:33:11 +0200 (Mon, 04 Jul 2016)
Log Message:
-----------
(push_uniq): use my with $reference, instead of local.

Modified Paths:
--------------
    trunk/Master/tlpkg/TeXLive/TLUtils.pm

Modified: trunk/Master/tlpkg/TeXLive/TLUtils.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLUtils.pm	2016-07-03 21:01:55 UTC (rev 41617)
+++ trunk/Master/tlpkg/TeXLive/TLUtils.pm	2016-07-03 23:33:11 UTC (rev 41618)
@@ -2961,28 +2961,26 @@
 }
 
 
-=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
 



More information about the tex-live-commits mailing list