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;