1. Shlomi Fish
  2. perl-Parser-MGC-hg

Commits

Shlomi Fish  committed 3731e09

Convert to avoid complex trailing conditions.

  • Participants
  • Parent commits b88427c
  • Branches default

Comments (0)

Files changed (1)

File lib/Parser/MGC.pm

View file
    my $str = $self->{str};
 
    my $sol = $pos;
-   $sol-- if $sol > 0 and substr( $str, $sol, 1 ) =~ m/^[\r\n]$/;
-   $sol-- while $sol > 0 and substr( $str, $sol-1, 1 ) !~ m/^[\r\n]$/;
+   if ($sol > 0 and substr( $str, $sol, 1 ) =~ m/^[\r\n]$/) {
+      $sol--;
+   }
+   while ($sol > 0 and substr( $str, $sol-1, 1 ) !~ m/^[\r\n]$/) {
+      $sol--;
+   }
 
    my $eol = $pos;
    $eol++ while $eol < length($str) and substr( $str, $eol, 1 ) !~ m/^[\r\n]$/;