Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: vcs_info: Remove a few superfluous stat()s
- X-seq: zsh-workers 30114
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: vcs_info: Remove a few superfluous stat()s
- Date: Thu, 19 Jan 2012 15:45:30 +0100
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author