This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Unicode::UCD::prop_invmap(): Use regex to get trie
authorKarl Williamson <public@khwilliamson.com>
Mon, 23 Jan 2012 19:43:42 +0000 (12:43 -0700)
committerKarl Williamson <public@khwilliamson.com>
Sat, 4 Feb 2012 23:29:30 +0000 (16:29 -0700)
This should speed up this test slightly

lib/Unicode/UCD.pm

index b1acac4..4480546 100644 (file)
@@ -2566,8 +2566,7 @@ RETRY:
     # The Name table is valid, but we need to execute the special code below
     # to add in the algorithmic-defined name entries.
     if (ref $swash eq ""
-        || $swash->{'TYPE'} eq 'ToBlk'
-        || $swash->{'TYPE'} eq 'ToNa')
+        || $swash->{'TYPE'} =~ / ^ To (?: Blk | Na) $ /x)
     {
 
         # Get the short name of the input property, in standard form