[Libreoffice-commits] .: solenv/bin
Caolán McNamara
caolan at kemper.freedesktop.org
Thu Dec 2 01:22:57 PST 2010
solenv/bin/modules/installer/scriptitems.pm | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
New commits:
commit 42239467e806f07d953c6dee1159c2b7d481f271
Author: Jordan Ayers <jordan.ayers at gmail.com>
Date: Tue Nov 30 22:36:28 2010 -0600
Accelerate perl installer: optimize installer::scriptitems::optimize_list().
Replace call to convert_stringlist_into_hash with a simpler method using split; this requires significantly fewer data copy operations.
The new routine strips all whitespace from the front and end of each value; the old function call stripped leading whitespace, most of the time.
diff --git a/solenv/bin/modules/installer/scriptitems.pm b/solenv/bin/modules/installer/scriptitems.pm
index b96b77b..6ba76fe 100644
--- a/solenv/bin/modules/installer/scriptitems.pm
+++ b/solenv/bin/modules/installer/scriptitems.pm
@@ -2031,11 +2031,16 @@ sub quoting_illegal_filenames
sub optimize_list
{
my ( $longlist ) = @_;
-
+ my %tmpHash;
my $shortlist = "";
- my $hashref = installer::converter::convert_stringlist_into_hash(\$longlist, ",");
- foreach my $key (sort keys %{$hashref} ) { $shortlist = "$shortlist,$key"; }
- $shortlist =~ s/^\s*\,//;
+
+ $longlist =~ s/^\s*|\s*$//g;
+ $longlist =~ s/\s*,\s*/,/g;
+
+ foreach ( split /,/, $longlist ) { $tmpHash{$_} = 1; }
+
+ foreach (sort keys %tmpHash ) { $shortlist .= "$_,"; }
+ chop( $shortlist );
return $shortlist;
}
More information about the Libreoffice-commits
mailing list