summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-12-14 03:01:43 +0000
committerNorbert Preining <norbert@preining.info>2019-12-14 03:01:43 +0000
commit2c20697e8a5301b61c59d752fd1cfa7499724eec (patch)
treed2475f5c56c14a7c38d26cfd2c5b71d4e0d824e0 /systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm
parentfdd3c58e8e5b37dcf9affd49326899988992c074 (diff)
CTAN sync 201912140301
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r--systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm
index e9c9002f4e..2b9aa1c547 100644
--- a/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm
+++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm
@@ -1,4 +1,4 @@
-# $Id: TLUtils.pm 53076 2019-12-10 06:20:44Z preining $
+# $Id: TLUtils.pm 53111 2019-12-12 23:22:05Z karl $
# TeXLive::TLUtils.pm - the inevitable utilities for TeX Live.
# Copyright 2007-2019 Norbert Preining, Reinhard Kotucha
# This file is licensed under the GNU General Public License version 2
@@ -6,7 +6,7 @@
package TeXLive::TLUtils;
-my $svnrev = '$Revision: 53076 $';
+my $svnrev = '$Revision: 53111 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -3612,15 +3612,20 @@ sub sort_uniq {
=item C<push_uniq(\@list, @new_items)>
-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.
+The C<push_uniq> function pushes each element in the last argument
+@ITEMS to the $LIST referenced by the first argument, if it is not
+already in the list.
=cut
sub push_uniq {
my ($l, @new_items) = @_;
for my $e (@new_items) {
- if (! &member($e, @$l)) {
+ # turns out this is one of the most-used functions when updating the
+ # tlpdb, with hundreds of thousands of calls. So let's write it out
+ # to eliminate the sub overhead.
+ #if (! &member($e, @$l)) {
+ if (! scalar grep($_ eq $e, @$l)) {
push (@$l, $e);
}
}