diff options
author | Karl Williamson <khw@cpan.org> | 2018-04-25 16:36:09 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-06-25 07:33:28 -0600 |
commit | e498c2357c8597abc34d35e971b89b066df52587 (patch) | |
tree | 97ad7a1f4a712b066282cf2f2bc8e2592d4e377d | |
parent | 73ed293a8767c586235ccdb2a5979f7a9f0249e5 (diff) | |
download | perl-e498c2357c8597abc34d35e971b89b066df52587.tar.gz |
regen/mk_invlists.pl: Slight speed up
Instead of checking each time if an element already exists in an array
before adding it, just add it, and afterwards remove all redundant ones.
-rw-r--r-- | charclass_invlists.h | 2 | ||||
-rw-r--r-- | regen/mk_invlists.pl | 8 | ||||
-rw-r--r-- | uni_keywords.h | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/charclass_invlists.h b/charclass_invlists.h index 8cba60f51b..0fda226c35 100644 --- a/charclass_invlists.h +++ b/charclass_invlists.h @@ -374285,5 +374285,5 @@ static const U8 WB_table[24][24] = { * 21653d2744fdd071f9ef138c805393901bb9547cf3e777ebf50215a191f986ea lib/unicore/version * 4bb677187a1a64e39d48f2e341b5ecb6c99857e49d7a79cf503bd8a3c709999b regen/charset_translations.pl * 03e51b0f07beebd5da62ab943899aa4934eee1f792fa27c1fb638c33bf4ac6ea regen/mk_PL_charclass.pl - * d3ca5c0fbf36f85475b811615af0c2ceafdb38cb74ce786b9c4e73d07730e733 regen/mk_invlists.pl + * 8490f46d7ca2e6ef92751349c7885ed1dd3cc97a78daa7cbcef2cf007973e758 regen/mk_invlists.pl * ex: set ro: */ diff --git a/regen/mk_invlists.pl b/regen/mk_invlists.pl index 0d10fcd9b6..acf119c636 100644 --- a/regen/mk_invlists.pl +++ b/regen/mk_invlists.pl @@ -751,9 +751,9 @@ for my $i (0 .. @$folds_ref - 1) { # Add to the non-finals list each code point that is in a non-final # position for my $j (0 .. @{$folds_ref->[$i]} - 2) { - push @is_non_final_fold, $folds_ref->[$i][$j] - unless grep { $folds_ref->[$i][$j] == $_ } @is_non_final_fold; + push @is_non_final_fold, $folds_ref->[$i][$j]; } + @is_non_final_fold = uniques @is_non_final_fold; } sub _Perl_Non_Final_Folds { @@ -2227,8 +2227,7 @@ foreach my $property (sort keys %utf8::loose_property_to_file_of; my $new_entry = $alias . $rhs; - push @this_entries, $new_entry - unless grep { $_ eq $new_entry } @this_entries; + push @this_entries, $new_entry; } } @@ -2271,6 +2270,7 @@ foreach my $property (sort $defined_to .= $enums{$tag}; # Go through the entries that evaluate to this. + @this_entries = uniques @this_entries; foreach my $define (@this_entries) { # There is a rule for the parser for each. diff --git a/uni_keywords.h b/uni_keywords.h index 331568aa84..bf274ea8ca 100644 --- a/uni_keywords.h +++ b/uni_keywords.h @@ -6755,6 +6755,6 @@ MPH_VALt match_uniprop( const unsigned char * const key, const U16 key_len ) { * 21653d2744fdd071f9ef138c805393901bb9547cf3e777ebf50215a191f986ea lib/unicore/version * 4bb677187a1a64e39d48f2e341b5ecb6c99857e49d7a79cf503bd8a3c709999b regen/charset_translations.pl * 03e51b0f07beebd5da62ab943899aa4934eee1f792fa27c1fb638c33bf4ac6ea regen/mk_PL_charclass.pl - * d3ca5c0fbf36f85475b811615af0c2ceafdb38cb74ce786b9c4e73d07730e733 regen/mk_invlists.pl + * 8490f46d7ca2e6ef92751349c7885ed1dd3cc97a78daa7cbcef2cf007973e758 regen/mk_invlists.pl * 5599d961e0e4ab42842b41d65db8a265c84e0b68e91a31d15585b7c9c8c6da53 regen/mph.pl * ex: set ro: */ |