@@ -42,36 +42,36 @@ my $static_libs_feature = 'static_libs_only';
4242# # 0 Preserve the order for additions (1) or invert it (0)
4343# # 1 Add this value to template input value (if there is one)
4444# # 2 Preserve <% %> settings for evaluation within the template
45- my %validNames = (' exename' => 1,
46- ' sharedname' => 1,
47- ' staticname' => 1,
48- ' libpaths' => 3,
49- ' recursive_libpaths' => 3,
45+ my %validNames = (' after' => 1,
46+ ' avoids' => 3,
47+ ' custom_only' => 1,
48+ ' dllout' => 1,
49+ ' dynamicflags' => 3,
50+ ' exename' => 1,
5051 ' exeout' => 1,
5152 ' includes' => 3,
52- ' recursive_includes' => 3,
53- ' after' => 1,
54- ' custom_only' => 1,
53+ ' libout' => 1,
54+ ' libpaths' => 3,
5555 ' libs' => 2,
5656 ' lit_libs' => 2,
57+ ' macros' => 3,
5758 ' managed' => 1,
58- ' pure_libs' => 2,
5959 ' pch_header' => 1,
6060 ' pch_source' => 1,
61- ' prebuild' => 5,
6261 ' postbuild' => 5,
6362 ' postclean' => 5,
64- ' dllout' => 1,
65- ' libout' => 1,
66- ' dynamicflags' => 3,
67- ' staticflags' => 3,
68- ' version' => 1,
63+ ' prebuild' => 5,
64+ ' pure_libs' => 2,
6965 ' recurse' => 1,
66+ ' recursive_includes' => 3,
67+ ' recursive_libpaths' => 3,
7068 ' requires' => 3,
71- ' avoids' => 3,
72- ' tagname' => 1,
69+ ' sharedname' => 1,
70+ ' staticflags' => 3,
71+ ' staticname' => 1,
7372 ' tagchecks' => 1,
74- ' macros' => 3,
73+ ' tagname' => 1,
74+ ' version' => 1,
7575 ' webapp' => 1,
7676 );
7777
@@ -1194,10 +1194,13 @@ sub process_component_line {
11941194 $line = $self -> relative($line );
11951195 $line =~ s /\\ / \/ / g if ($self -> {' convert_slashes' });
11961196
1197- # # Now look for specially listed files
1197+ # # Now look for specially listed files.
1198+ # # Regular expressions are very slow. Searching the line twice with
1199+ # # index() is 328 times faster than searching with just the regular
1200+ # # expression when it doesn't match (which is likely to be the case).
11981201 if ((index ($line , ' >>' ) >= 0 || index ($line , ' <<' ) >= 0) &&
11991202 $line =~ / (.*)\s +(>>|<<)\s +(.*)/ ) {
1200- $line = $1 ;
1203+ $line = $1 ;
12011204 my $oop = $2 ;
12021205 my $iop = ($oop eq ' >>' ? ' <<' : ' >>' );
12031206 my $out = ($oop eq ' >>' ? $3 : undef );
@@ -3110,14 +3113,18 @@ sub generate_default_components {
31103113
31113114sub remove_duplicated_files {
31123115 my ($self , $dest , $source ) = @_ ;
3113- my $names = $self -> {$dest };
31143116 my @slist = $self -> get_component_list($source , 1);
3115- my %shash ;
31163117
3118+ # # There's no point in going on if there's nothing in this component
3119+ # # list.
3120+ return undef if ($#slist == -1);
3121+
31173122 # # Convert the array into keys for a hash table
3123+ my %shash ;
31183124 @shash {@slist } = ();
31193125
31203126 # # Find out which source files are listed
3127+ my $names = $self -> {$dest };
31213128 foreach my $name (keys %$names ) {
31223129 foreach my $key (keys %{$$names {$name }}) {
31233130 my $array = $$names {$name }-> {$key };
0 commit comments