pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Converted PkgLint::FileUtils::L...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9b66742fc5e8
branches:  trunk
changeset: 497666:9b66742fc5e8
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Mon Aug 01 22:29:13 2005 +0000

description:
Converted PkgLint::FileUtils::Line to use an array instead of a hash for
saving the fields. This gives a 5 percent speed-up.

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (41 lines):

diff -r cc3a2b229336 -r 9b66742fc5e8 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Mon Aug 01 21:48:48 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Mon Aug 01 22:29:13 2005 +0000
@@ -11,7 +11,7 @@
 # Freely redistributable.  Absolutely no warranty.
 #
 # From Id: portlint.pl,v 1.64 1998/02/28 02:34:05 itojun Exp
-# $NetBSD: pkglint.pl,v 1.224 2005/08/01 21:28:06 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.225 2005/08/01 22:29:13 rillig Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by:
@@ -190,21 +190,21 @@
 #==========================================================================
 sub new($$$$) {
        my ($class, $file, $lineno, $text) = @_;
-       my ($self) = ({});
+       my ($self) = ([]);
        bless($self, $class);
-       $self->{"file"} = $file;
-       $self->{"lineno"} = $lineno;
-       $self->{"text"} = $text;
+       $self->[0] = $file;
+       $self->[1] = $lineno;
+       $self->[2] = $text;
        return $self;
 }
 sub file($) {
-       return shift(@_)->{"file"};
+       return shift(@_)->[0];
 }
 sub lineno($) {
-       return shift(@_)->{"lineno"};
+       return shift(@_)->[1];
 }
 sub text($) {
-       return shift(@_)->{"text"};
+       return shift(@_)->[2];
 }
 
 sub log_error($$) {



Home | Main Index | Thread Index | Old Index