Unicode::UCD: Allow prop_invmap() to work on non-compact binary properties
authorKarl Williamson <public@khwilliamson.com>
Fri, 30 Dec 2011 04:54:42 +0000 (21:54 -0700)
committerKarl Williamson <public@khwilliamson.com>
Fri, 30 Dec 2011 18:08:28 +0000 (11:08 -0700)
It may be that the tables input to prop_invmap() are not in the most
compact form.  There was a problem coping with these on binary
properties; which this commit fixes by realizing that a binary property
omits its 'Y' property value.

The .t does not pass these tests when the input is not compact, though.

lib/Unicode/UCD.pm

index b5d57e5..db95111 100644 (file)
@@ -2818,7 +2818,10 @@ RETRY:
             # We now see that it should be
             # 12 => XYZ
             # 18 => $missing
-            if (@invlist > 1 && $invmap[-2] eq $map) {
+            if (@invlist > 1 && ( (defined $map)
+                                  ? $invmap[-2] eq $map
+                                  : $invmap[-2] eq 'Y'))
+            {
                 $invlist[-1] = $end + 1;
                 next;
             }