This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8_heavy: Reorder 2 if's
authorKarl Williamson <public@khwilliamson.com>
Sat, 5 Nov 2011 16:34:01 +0000 (10:34 -0600)
committerKarl Williamson <public@khwilliamson.com>
Tue, 8 Nov 2011 15:09:34 +0000 (08:09 -0700)
This saves a little redundant code, and will be useful in future commits

lib/utf8_heavy.pl

index 777e11a..0bb1cdd 100644 (file)
@@ -422,17 +422,14 @@ sub _loose_name ($) {
                 ## The user-level way to access ToDigit() and ToFold()
                 ## is to use Unicode::UCD.
                 ##
-                if ($type =~ /^To(Digit|Fold|Lower|Title|Upper)$/) {
 
-                    # Fail if wanting a binary property, as these aren't.
-                    if ($minbits == 1) {
-                        pop @recursed if @recursed;
-                        return $type;
-                    }
+                if ($minbits != 1) {    # Only check if caller wants non-binary
+                if ($type =~ /^To(Digit|Fold|Lower|Title|Upper)$/) {
                     $file = "$unicore_dir/To/$1.pl";
                     ## would like to test to see if $file actually exists....
                     last GETFILE;
                 }
+                }
 
                 ##
                 ## If we reach this line, it's because we couldn't figure