simplifiy
parent
f9fd71df88
commit
529a06b7cc
|
@ -486,8 +486,9 @@ sub rename_hook (@) {
|
|||
my $q=$params{cgi};
|
||||
my $session=$params{session};
|
||||
|
||||
return () unless @torename;
|
||||
|
||||
my @nextset;
|
||||
if (@torename) {
|
||||
foreach my $torename (@torename) {
|
||||
unless (exists $done{$torename->{src}} && $done{$torename->{src}}) {
|
||||
IkiWiki::run_hooks(rename => sub {
|
||||
|
@ -507,14 +508,10 @@ sub rename_hook (@) {
|
|||
session => $session,
|
||||
);
|
||||
|
||||
# remove duplicates from @torename
|
||||
# dedup
|
||||
my %seen;
|
||||
return grep { ! $seen{$_->{src}}++ } @torename;
|
||||
}
|
||||
else {
|
||||
return ();
|
||||
}
|
||||
}
|
||||
|
||||
sub do_rename ($$$) {
|
||||
my $rename=shift;
|
||||
|
|
Loading…
Reference in New Issue