From owner-svn-src-all@FreeBSD.ORG Sun Aug 24 16:40:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52A71C53; Sun, 24 Aug 2014 16:40:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E01D3D58; Sun, 24 Aug 2014 16:40:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7OGeVtv003080; Sun, 24 Aug 2014 16:40:31 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7OGeVFa003079; Sun, 24 Aug 2014 16:40:31 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201408241640.s7OGeVFa003079@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 24 Aug 2014 16:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270505 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Aug 2014 16:40:32 -0000 Author: dteske Date: Sun Aug 24 16:40:31 2014 New Revision: 270505 URL: http://svnweb.freebsd.org/changeset/base/270505 Log: Optimize f_which() to be slightly faster still. Modified: head/usr.sbin/bsdconfig/share/common.subr Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Sun Aug 24 16:37:50 2014 (r270504) +++ head/usr.sbin/bsdconfig/share/common.subr Sun Aug 24 16:40:31 2014 (r270505) @@ -263,10 +263,10 @@ f_which() { local __name="$1" __var_to_set="$2" case "$__name" in */*|'') return $FAILURE; esac - local __p IFS=":" __found= + local __p __exec IFS=":" __found= for __p in $PATH; do - local __exec="$__p/$__name" - [ -f "$__exec" -a -x "$__exec" ] && __found=1 && break + __exec="$__p/$__name" + [ -f "$__exec" -a -x "$__exec" ] && __found=1 break done if [ "$__found" ]; then if [ "$__var_to_set" ]; then