[lintian] 03/03: L::L::Manifest: Only load L::L::ManifestDiff if needed
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository lintian.
commit fa7f2803071c9009a8753a3c8c2198f1903761b9
Author: Niels Thykier <niels@thykier.net>
Date: Fri Jan 22 21:29:35 2016 +0000
L::L::Manifest: Only load L::L::ManifestDiff if needed
Signed-off-by: Niels Thykier <niels@thykier.net>
---
lib/Lintian/Lab/Manifest.pm | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/lib/Lintian/Lab/Manifest.pm b/lib/Lintian/Lab/Manifest.pm
index 0c14dc2..f37a8e6 100644
--- a/lib/Lintian/Lab/Manifest.pm
+++ b/lib/Lintian/Lab/Manifest.pm
@@ -28,8 +28,6 @@ use parent qw(Class::Accessor::Fast Clone);
use Carp qw(croak);
-use Lintian::Lab::ManifestDiff;
-
=head1 NAME
Lintian::Lab::Manifest -- Lintian Lab manifest
@@ -469,11 +467,7 @@ L<Lintian::Lab::ManifestDiff> for more information.
sub diff {
my ($self, $other) = @_;
croak 'Cannot diff a GROUP manifest' if $self->type eq 'GROUP';
- my $copy;
- my @changed;
- my @added;
- my @removed;
- my $visitor;
+ my ($copy, @changed, @added, @removed, $visitor);
unless ($self->{'type'} eq $other->{'type'}) {
my $st = $self->{'type'};
my $ot = $other->{'type'};
@@ -503,6 +497,8 @@ sub diff {
# Thus we can just add all of these entries to @removed. :)
$copy->visit_all(sub { my (undef, @keys) = @_; push @removed, \@keys; });
+ require Lintian::Lab::ManifestDiff;
+
return Lintian::Lab::ManifestDiff->_new($self->{'type'}, $other, $self,
\@added, \@removed, \@changed);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: