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

[lintian] 08/08: L::Path: Inline _is_type helper into its callers



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

nthykier pushed a commit to branch master
in repository lintian.

commit aba34d88a98ae5feaeef31760c2f9eeb4e575b29
Author: Niels Thykier <niels@thykier.net>
Date:   Tue Feb 25 23:35:51 2014 +0100

    L::Path: Inline _is_type helper into its callers
    
    The helper method is not really that helpful and carries a measurable
    overhead on "very large packages" (hi chromium-browser).
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 lib/Lintian/Path.pm | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/lib/Lintian/Path.pm b/lib/Lintian/Path.pm
index 36624ee..9694a0d 100644
--- a/lib/Lintian/Path.pm
+++ b/lib/Lintian/Path.pm
@@ -192,12 +192,6 @@ sub children {
     return @{ $self->{'children'} };
 }
 
-# Backing method implementing the is_X tests
-sub _is_type {
-    my ($self, $t) = @_;
-    return $self->type eq $t;
-}
-
 =item is_symlink
 
 Returns a truth value if this entry is a symlink.
@@ -233,11 +227,11 @@ symlinks, even if the symlink points to a file.
 
 =cut
 
-sub is_symlink { return $_[0]->_is_type('l'); }
-sub is_hardlink { return $_[0]->_is_type('h'); }
-sub is_dir { return $_[0]->_is_type('d'); }
-sub is_file { return $_[0]->_is_type('-') || $_[0]->_is_type('h'); }
-sub is_regular_file  { return $_[0]->_is_type('-'); }
+sub is_symlink { return $_[0]->type eq 'l'; }
+sub is_hardlink { return $_[0]->type eq 'h'; }
+sub is_dir { return $_[0]->type eq 'd'; }
+sub is_file { return $_[0]->type eq '-' || $_[0]->type eq 'h'; }
+sub is_regular_file  { return $_[0]->type eq '-'; }
 
 =item link_normalized
 

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


Reply to: