Commits

Burak Gürsoy committed 163f453

Optimize

Comments (0)

Files changed (1)

lib/Lingua/TR/ASCII.pm

 
     my $morph = sub {
         my($next, $lookup) = @_;
+        $index = $point;
         $space = 0;
         while ( $next->() ) {
             my $char = substr $self->{turkish}, $index, 1;
         }
     };
 
-    $s     = q{ } x ( 1 + ( 2 * $size ) );
-    $i     = 1 + $size;
-    $index = $point;
+    $s = q{ } x ( 1 + ( 2 * $size ) );
+    $i = 1 + $size;
     substr $s, $size, 1, 'X';
 
     $morph->(
         $DOWNCASE_ASCIIFY
     );
 
-    $s     = substr $s, 0, $i;
-    $i     = 0 - --$size;
-    $index = $point;
+    $s = substr $s, 0, $i;
+    $i = 0 - --$size;
 
     $morph->(
         sub { $i <= 0 && --$index >= 0 },