diff options
author | 2007-04-30 13:51:32 +0000 | |
---|---|---|
committer | 2007-04-30 13:51:32 +0000 | |
commit | b5c92c36b4a0619808e4c67112bef64915cba99f (patch) | |
tree | de9f86b355310de11ae975aa1b6f4255814d4f5c | |
parent | add missing newline in printf (diff) | |
download | wireguard-openbsd-b5c92c36b4a0619808e4c67112bef64915cba99f.tar.xz wireguard-openbsd-b5c92c36b4a0619808e4c67112bef64915cba99f.zip |
don't bother trying to substitute if there's no $ in the string.
According to perl's profiler, this actually accounts for *most* of the
user time of pkg_create...
-rw-r--r-- | usr.sbin/pkg_add/pkg_create | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create index 081f065a120..3844a36238e 100644 --- a/usr.sbin/pkg_add/pkg_create +++ b/usr.sbin/pkg_add/pkg_create @@ -1,6 +1,6 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_create,v 1.82 2007/04/30 12:39:31 espie Exp $ +# $OpenBSD: pkg_create,v 1.83 2007/04/30 13:51:32 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -316,6 +316,7 @@ my %defines; sub dosubst { local $_ = shift; + return $_ unless m/\$/; while (my ($k, $v) = each %defines) { s/\$\{\Q$k\E\}/$v/g; } |