Skip to content

Commit

Permalink
Issue #87: use the current_sub feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
bschmalhofer committed Jun 30, 2020
1 parent c1776f2 commit cc510c2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Kernel/System/ObjectManager.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package Kernel::System::ObjectManager;
## nofilter(TidyAll::Plugin::OTOBO::Perl::Require)
## nofilter(TidyAll::Plugin::OTOBO::Perl::SyntaxCheck)

use strict;
use 5.24.0;
use warnings;

use Carp ();
Expand Down Expand Up @@ -532,12 +532,13 @@ sub ObjectsDiscard {
# second step: post-order recursive traversal
my %Seen;
my @OrderedObjects;
my $Traverser;
$Traverser = sub {
my $Traverser = sub {
my ($Object) = @_;

return if $Seen{$Object}++;

for my $ReverseDependency ( sort keys %{ $ReverseDependencies{$Object} } ) {
$Traverser->($ReverseDependency);
__SUB__->($ReverseDependency);
}
push @OrderedObjects, $Object;
};
Expand Down

0 comments on commit cc510c2

Please sign in to comment.