From 83d931ee07168463e1a6251be818a0a822980a80 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 26 Jan 2012 21:01:33 -0700 Subject: [PATCH] mktables: Refactor if-else series This is a slight refactoring to avoid using 'next' in the loop, and to surround things with a bare block. Future commits will want to do common code at the bottom of the loop, including a redo of the bare block. --- lib/unicore/mktables | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/unicore/mktables b/lib/unicore/mktables index 24cf411..5755e0a 100644 --- a/lib/unicore/mktables +++ b/lib/unicore/mktables @@ -5257,6 +5257,8 @@ END next RANGE if defined $suppress_value && $value eq $suppress_value; + { + # If there is a range and doesn't need a single point range # output if ($start != $end && ! $range_size_1) { @@ -5281,13 +5283,11 @@ END $count); $OUT[-1] = Text::Tabs::unexpand($OUT[-1]); } - next RANGE; } - # Here to output a single code point per line - - # If not to annotate, use the simple formats - if (! $annotate) { + # Here to output a single code point per line. + # If not to annotate, use the simple formats + elsif (! $annotate) { # Use any passed in subroutine to output. if (ref $range_size_1 eq 'CODE') { @@ -5302,8 +5302,8 @@ END push @OUT, sprintf "%04X\t\t%s\n", $i, $value; } } - next RANGE; } + else { # Here, wants annotation. for (my $i = $start; $i <= $end; $i++) { @@ -5442,6 +5442,8 @@ END $OUT[-1] .= "\n"; } } + } + } } # End of loop through all the table's ranges } -- 1.8.3.1