diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2005-06-26 11:23:36 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2005-06-26 11:23:36 +0000 |
commit | d5f8adf726849e20e7f584628cde2dedbf36cd4c (patch) | |
tree | 1b33f7c4263b90b784706724fb851c4bd2442df1 | |
parent | 166038339d8c2a7f49cc7b2ed35429b85e34fd22 (diff) |
faster fat package finder
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingList.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm index 62a6443209a..76518a0d17c 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingList.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingList.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingList.pm,v 1.45 2005/06/21 19:12:31 espie Exp $ +# $OpenBSD: PackingList.pm,v 1.46 2005/06/26 11:23:35 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -163,7 +163,12 @@ sub FatOnly my ($fh, $cont) = @_; local $_; while (<$fh>) { - next unless m/^\@(?:name\b|arch\b)/o; + # XXX optimization + if (m/^\@arch\b/o) { + &$cont($_); + return; + } + next unless m/^\@(?:name\b)/o; &$cont($_); } } |