-sub calculate_changed_links ($) {
- my $file=shift;
- my $page=pagename($file);
- if (exists $links{$page}) {
- foreach my $l (@{$links{$page}}) {
- my $target=bestlink($page, $l);
- if (! exists $oldlink_targets{$page}{$l} ||
- $target ne $oldlink_targets{$page}{$l}) {
- $backlinkchanged{$l}=1;
- $linkchangers{lc($page)}=1;
+sub calculate_changed_links ($$$) {
+ my ($changed, $del, $oldlink_targets)=@_;
+
+ my (%backlinkchanged, %linkchangers);
+
+ foreach my $file (@$changed, @$del) {
+ my $page=pagename($file);
+
+ if (exists $links{$page}) {
+ foreach my $l (@{$links{$page}}) {
+ my $target=bestlink($page, $l);
+ if (! exists $oldlink_targets->{$page}{$l} ||
+ $target ne $oldlink_targets->{$page}{$l}) {
+ $backlinkchanged{$l}=1;
+ $linkchangers{lc($page)}=1;
+ }
+ delete $oldlink_targets->{$page}{$l};