Skip to content

Commit

Permalink
Fix compile time error where parentheses were against keywords such a…
Browse files Browse the repository at this point in the history
…s my or while.
  • Loading branch information
Takadonet committed Jan 19, 2011
1 parent cfd2baf commit cbe97b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/Algorithm/Diff.pm
Original file line number Diff line number Diff line change
Expand Up @@ -442,12 +442,12 @@ sub compact_diff( @a, @b, &keyGen = &default_keyGen ) is export
push @cdiff, $ai, $bi;
while ( 1 )
{
while( $am && $ai == $am.[0] && $bi == $bm.[0] )
while ( $am && $ai == $am.[0] && $bi == $bm.[0] )
{
shift $am;
shift $bm;
++$ai, ++$bi;
}
}
push @cdiff, $ai, $bi;
last if !$am;
$ai = $am.[0];
Expand Down Expand Up @@ -501,7 +501,7 @@ has $_Min = -2; # Added to _Off to get min instead of max+1
method new ( @seq1, @seq2, &keyGen = &default_keyGen ) {
my @cdif = &compact_diff( @seq1, @seq2, &keyGen );
my $same = 1;
if( 0 == @cdif[2] && 0 == @cdif[3] ) {
if ( 0 == @cdif[2] && 0 == @cdif[3] ) {
$same = 0;
@cdif.splice( 0, 2 );
}
Expand Down
8 changes: 4 additions & 4 deletions t/oo.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use Algorithm::Diff;

my $undef;

my( $a, $b, $hunks );
my ( $a, $b, $hunks );
for (
[ "a b c e h j l m n p", " b c d e f j k l m r s t", 9 ],
[ "", "", 0 ],
Expand Down Expand Up @@ -102,17 +102,17 @@ for (
is( $c.Next(0), $d.Next(0), 'Copy with parameters iterates correctly' );

$d.Reset();
my( @A, @B );
my ( @A, @B );

# The two tests in the following group marked with the comments are different
# from the perl5 tests. .Same and .Items return elements and .Range returns
# indicies. The perl 5 tests were comparing array refs in scalar context so they
# would pass as long as they both were the same size. Now they check to see if
# they have the same contents.

while( $d.Next ) {
while ( $d.Next ) {
my $i = 1;
if( $d.Same ) {
if ( $d.Same ) {
is( $d.Diff, 0, "if loop sequence #{$i++}" );
is( $d.Same, @b[$d.Range(2)], "if loop sequence #{$i++}" ); # different from perl 5 !!
is( $d.Items(2), @a[$d.Range(1)], "if loop sequence #{$i++}" ); # different from perl 5 !!
Expand Down

0 comments on commit cbe97b8

Please sign in to comment.