regen/regcharclass.pl: Refactor a 'return' slightly
authorKarl Williamson <public@khwilliamson.com>
Sat, 20 Oct 2012 17:25:50 +0000 (11:25 -0600)
committerKarl Williamson <public@khwilliamson.com>
Sat, 20 Oct 2012 19:27:31 +0000 (13:27 -0600)
Instead of having a common return at the end of the function, this does
that same return at an intermediate point.  The reason is that a future
commit will change the final return somewhat, and this seemed the
clearest way to go.

regen/regcharclass.pl

index 461192b..b95d740 100755 (executable)
@@ -755,8 +755,9 @@ sub _cond_as_str {
                 @$_ )
             : sprintf( "$self->{val_fmt} == $test", $_ );
         } @ranges;
+
+        return "( " . join( " || ", @ranges ) . " )";
     }
-    else {
         # If the input set has certain characteristics, we can optimize tests
         # for it.  This doesn't apply if returning the code point, as we want
         # each element of the set individually.  The code above is for this
@@ -853,7 +854,6 @@ sub _cond_as_str {
                 }
             }
         }
-    }
 
     return "( " . join( " || ", @ranges ) . " )";