Skip Menu |

This queue is for tickets about the Net-Twitter-Diff CPAN distribution.

Report information
The Basics
Id: 43699
Status: resolved
Priority: 0/
Queue: Net-Twitter-Diff

People
Owner: Nobody in particular
Requestors: blom [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.04
Fixed in: (no value)



Subject: Diff'ing non sorted array refs
Hi, Net::Twitter::Diff is assuming the input is sorted, which (in my case) is not always the same. This simple patch makes sure that the compared array-refs are sorted and thus more reliable results come out of it. -- B10m
Subject: Net-Twitter-Diff.patch
--- /Users/mblom/perl/lib/site_perl/5.10.0/Net/Twitter/Diff.pm 2009-02-27 13:27:37.000000000 +0100 +++ /Users/mblom/perl/lib/site_perl/5.10.0/Net/Twitter/Diff.pm.old 2009-02-27 13:27:04.000000000 +0100 @@ -78,7 +78,7 @@ push @{ $followers } , $item->{screen_name}; } - my $diff = Array::Diff->diff( [ sort @{$followers} ] , [ sort @{$followings} ] ); + my $diff = Array::Diff->diff( $followers , $followings ); $res->{not_following} = $diff->deleted; $res->{not_followed} = $diff->added;
And now a non-reverse patch ;-) -- B10m
--- Net/Twitter/Diff.pm.old 2009-02-27 13:27:04.000000000 +0100 +++ Net/Twitter/Diff.pm 2009-02-27 13:27:37.000000000 +0100 @@ -78,7 +78,7 @@ push @{ $followers } , $item->{screen_name}; } - my $diff = Array::Diff->diff( $followers , $followings ); + my $diff = Array::Diff->diff( [ sort @{$followers} ] , [ sort @{$followings} ] ); $res->{not_following} = $diff->deleted; $res->{not_followed} = $diff->added;