From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23541 invoked by alias); 19 Jan 2012 14:57:19 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30114 Received: (qmail 18251 invoked from network); 19 Jan 2012 14:57:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: zsh-workers@zsh.org Subject: PATCH: vcs_info: Remove a few superfluous stat()s User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux) Date: Thu, 19 Jan 2012 15:45:30 +0100 Message-ID: <87bopz3g51.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain X-Df-Sender: [pbs]MDExNTM1 The (( ${+commands[foo]} )) part should be save enough, to check for existing commands. Regards, Frank diff --git a/Functions/VCS_Info/VCS_INFO_check_com b/Functions/VCS_Info/VCS_INFO_check_com index d9f7a13..1b86593 100644 --- a/Functions/VCS_Info/VCS_INFO_check_com +++ b/Functions/VCS_Info/VCS_INFO_check_com @@ -9,7 +9,7 @@ case $1 in [[ -x $1 ]] && return 0 ;; (*) - (( ${+commands[$1]} )) && [[ -x ${commands[$1]} ]] && return 0 + (( ${+commands[$1]} )) && return 0 esac return 1