[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 02/02: L::C::Package: Factor out a repeated fetch operation



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit 08910db5ef675fc13fcacf5ca5f1a44bad80c815
Author: Niels Thykier <niels@thykier.net>
Date:   Tue Oct 7 22:56:40 2014 +0200

    L::C::Package: Factor out a repeated fetch operation
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 lib/Lintian/Collect/Package.pm | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/Lintian/Collect/Package.pm b/lib/Lintian/Collect/Package.pm
index ad1b09f..80269cf 100644
--- a/lib/Lintian/Collect/Package.pm
+++ b/lib/Lintian/Collect/Package.pm
@@ -549,7 +549,8 @@ sub _fetch_index_data {
     foreach my $file (reverse @sorted) {
         # Add them in reverse order - entries in a dir are made
         # objects before the dir itself.
-        if ($idxh{$file}->{type} eq 'd') {
+        my $entry = $idxh{$file};
+        if ($entry->{'type'} eq 'd') {
             my (%child_table, @sorted_children);
             for my $cname (sort(@{ $children{$file} })) {
                 my $child = $idxh{$cname};
@@ -564,12 +565,12 @@ sub _fetch_index_data {
                 push(@sorted_children, $child);
             }
             @sorted_children = reverse(@sorted_children);
-            $idxh{$file}{_sorted_children} = \@sorted_children;
-            $idxh{$file}{children} = \%child_table;
+            $entry->{'_sorted_children'} = \@sorted_children;
+            $entry->{'children'} = \%child_table;
         }
         # Insert name here to share the same storage with the hash key
-        $idxh{$file}{'name'} = $file;
-        $idxh{$file} = Lintian::Path->new($idxh{$file});
+        $entry->{'name'} = $file;
+        $idxh{$file} = Lintian::Path->new($entry);
     }
     $self->{$field} = \%idxh;
     # Remove the "top" dir in the sorted_index as it is hardly ever

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: